From d66a86c3d3395d25c06c201d14e33a9156a289e0 Mon Sep 17 00:00:00 2001 From: cloudpdf-sdk-bot Date: Wed, 16 Sep 2026 20:45:27 +0000 Subject: [PATCH] chore: generate CloudPDF .NET SDK 3.0.0-next.13 --- .fern/metadata.json | 6 +- cloudpdf-generation.json | 8 +- reference.md | 648 +++++++++++++ .../MockServer/Doc/Annotations/CreateTest.cs | 4 + .../MockServer/Doc/Annotations/DeleteTest.cs | 4 + .../MockServer/Doc/Annotations/FlattenTest.cs | 4 + .../MockServer/Doc/Annotations/UpdateTest.cs | 4 + .../MockServer/Doc/Forms/ImportDataTest.cs | 4 + .../Unit/MockServer/Doc/Forms/ResetTest.cs | 4 + .../Unit/MockServer/Doc/Forms/SetValueTest.cs | 4 + .../Unit/MockServer/Doc/ManifestTest.cs | 6 + .../Unit/MockServer/Doc/Pages/DeleteTest.cs | 4 + .../Unit/MockServer/Doc/Pages/FlattenTest.cs | 4 + .../MockServer/Doc/Pages/InsertBlankTest.cs | 4 + .../Unit/MockServer/Doc/Pages/MoveTest.cs | 4 + .../MockServer/Doc/Pages/RemoveNameTest.cs | 4 + .../Unit/MockServer/Doc/Pages/RotateTest.cs | 4 + .../Unit/MockServer/Doc/Pages/SetNameTest.cs | 4 + .../MockServer/Doc/Redactions/ApplyTest.cs | 4 + .../MockServer/Doc/Signatures/AbortTest.cs | 79 ++ .../MockServer/Doc/Signatures/AnalysisTest.cs | 210 +++++ .../MockServer/Doc/Signatures/CompleteTest.cs | 397 ++++++++ .../MockServer/Doc/Signatures/ListTest.cs | 338 +++++++ .../MockServer/Doc/Versions/AnalysisTest.cs | 210 +++++ .../Unit/MockServer/Doc/Versions/ListTest.cs | 100 +++ .../MockServer/Doc/Versions/SignaturesTest.cs | 338 +++++++ src/CloudPDF/CloudPDF.csproj | 2 +- src/CloudPDF/Core/Public/Version.cs | 2 +- src/CloudPDF/Doc/DocClient.cs | 6 + src/CloudPDF/Doc/IDocClient.cs | 2 + .../Doc/Signatures/ISignaturesClient.cs | 48 + .../Requests/AbortSignaturesRequest.cs | 29 + .../Requests/AnalysisSignaturesRequest.cs | 35 + .../Requests/DocSignaturesCompleteRequest.cs | 35 + .../Requests/ListSignaturesRequest.cs | 26 + .../Requests/PrepareSignaturesRequest.cs | 29 + .../Doc/Signatures/SignaturesClient.cs | 739 +++++++++++++++ .../Types/AnalysisSignaturesRequestLevel.cs | 124 +++ ...ignaturesCompleteRequestExpectedVersion.cs | 32 + src/CloudPDF/Doc/Versions/IVersionsClient.cs | 60 ++ .../Requests/AnalysisVersionsRequest.cs | 41 + .../Requests/DownloadVersionsRequest.cs | 26 + .../Versions/Requests/ListVersionsRequest.cs | 23 + .../Requests/RevisionVersionsRequest.cs | 29 + .../SignatureContentsVersionsRequest.cs | 29 + .../SignatureDigestVersionsRequest.cs | 32 + .../Requests/SignaturesVersionsRequest.cs | 26 + .../Types/AnalysisVersionsRequestLevel.cs | 124 +++ ...SignatureDigestVersionsRequestAlgorithm.cs | 128 +++ src/CloudPDF/Doc/Versions/VersionsClient.cs | 849 ++++++++++++++++++ ...otationsCreate200ResponseMetaCacheDelta.cs | 6 + .../DocAnnotationsCreate400ResponseCode.cs | 34 + .../DocAnnotationsCreate404ResponseCode.cs | 34 + ...otationsDelete200ResponseMetaCacheDelta.cs | 6 + .../DocAnnotationsDelete404ResponseCode.cs | 34 + ...otationsExportAppearance400ResponseCode.cs | 35 + ...otationsExportAppearance404ResponseCode.cs | 35 + ...tationsFlatten200ResponseMetaCacheDelta.cs | 6 + .../DocAnnotationsFlatten400ResponseCode.cs | 34 + .../DocAnnotationsFlatten404ResponseCode.cs | 34 + ...sList200ResponseAnnotationsItemFreeText.cs | 5 +- ...sponseAnnotationsItemFreeTextFontFamily.cs | 191 ---- ...ResponseAnnotationsItemFreeTextRichText.cs | 32 + ...onseAnnotationsItemFreeTextRichTextBody.cs | 71 ++ ...nnotationsItemFreeTextRichTextBodyAlign.cs | 145 +++ ...sItemFreeTextRichTextBodyDecorationItem.cs | 144 +++ ...eAnnotationsItemFreeTextRichTextBodyDir.cs | 135 +++ ...otationsItemFreeTextRichTextBodyMargins.cs | 38 + ...notationsItemFreeTextRichTextBodyScript.cs | 140 +++ ...tionsItemFreeTextRichTextParagraphsItem.cs | 48 + ...ItemFreeTextRichTextParagraphsItemAlign.cs | 149 +++ ...nsItemFreeTextRichTextParagraphsItemDir.cs | 139 +++ ...emFreeTextRichTextParagraphsItemMargins.cs | 38 + ...mFreeTextRichTextParagraphsItemRunsItem.cs | 32 + ...TextRichTextParagraphsItemRunsItemStyle.cs | 56 ++ ...ragraphsItemRunsItemStyleDecorationItem.cs | 144 +++ ...chTextParagraphsItemRunsItemStyleScript.cs | 144 +++ .../DocAnnotationsList404ResponseCode.cs | 34 + ...esponsePagesItemAnnotationsItemFreeText.cs | 5 +- ...agesItemAnnotationsItemFreeTextRichText.cs | 33 + ...ItemAnnotationsItemFreeTextRichTextBody.cs | 72 ++ ...nnotationsItemFreeTextRichTextBodyAlign.cs | 149 +++ ...sItemFreeTextRichTextBodyDecorationItem.cs | 144 +++ ...mAnnotationsItemFreeTextRichTextBodyDir.cs | 139 +++ ...otationsItemFreeTextRichTextBodyMargins.cs | 38 + ...notationsItemFreeTextRichTextBodyScript.cs | 144 +++ ...tionsItemFreeTextRichTextParagraphsItem.cs | 48 + ...temFreeTextRichTextParagraphsItemAlign.cs} | 110 +-- ...nsItemFreeTextRichTextParagraphsItemDir.cs | 139 +++ ...emFreeTextRichTextParagraphsItemMargins.cs | 38 + ...mFreeTextRichTextParagraphsItemRunsItem.cs | 32 + ...TextRichTextParagraphsItemRunsItemStyle.cs | 56 ++ ...ragraphsItemRunsItemStyleDecorationItem.cs | 144 +++ ...chTextParagraphsItemRunsItemStyleScript.cs | 144 +++ .../DocAnnotationsListAll404ResponseCode.cs | 34 + .../DocAnnotationsListAll409ResponseCode.cs | 34 + ...otationsUpdate200ResponseMetaCacheDelta.cs | 6 + .../DocAnnotationsUpdate400ResponseCode.cs | 34 + .../DocAnnotationsUpdate404ResponseCode.cs | 34 + src/CloudPDF/Types/DocDownloadResponseCode.cs | 28 + .../Types/DocFormsExportDataResponseCode.cs | 34 + .../Types/DocFormsGet404ResponseCode.cs | 30 + ...ormsImportData200ResponseMetaCacheDelta.cs | 6 + .../DocFormsImportData400ResponseCode.cs | 34 + .../DocFormsImportData404ResponseCode.cs | 34 + .../DocFormsReset200ResponseMetaCacheDelta.cs | 6 + .../Types/DocFormsReset404ResponseCode.cs | 30 + ...cFormsSetValue200ResponseMetaCacheDelta.cs | 6 + .../Types/DocFormsSetValue400ResponseCode.cs | 34 + .../Types/DocFormsSetValue404ResponseCode.cs | 34 + src/CloudPDF/Types/DocHead404ResponseCode.cs | 26 + src/CloudPDF/Types/DocManifest200Response.cs | 9 + .../Types/DocManifest404ResponseCode.cs | 30 + .../Types/DocMetadataGet404ResponseCode.cs | 34 + ...DocPagesDelete200ResponseMetaCacheDelta.cs | 6 + .../Types/DocPagesDelete400ResponseCode.cs | 34 + .../Types/DocPagesDelete404ResponseCode.cs | 34 + .../Types/DocPagesExtract400ResponseCode.cs | 34 + .../Types/DocPagesExtract404ResponseCode.cs | 34 + ...ocPagesFlatten200ResponseMetaCacheDelta.cs | 6 + .../Types/DocPagesFlatten400ResponseCode.cs | 34 + .../Types/DocPagesFlatten404ResponseCode.cs | 34 + ...DocPagesInsert200ResponseMetaCacheDelta.cs | 6 + .../Types/DocPagesInsert400ResponseCode.cs | 34 + .../Types/DocPagesInsert404ResponseCode.cs | 34 + ...gesInsertBlank200ResponseMetaCacheDelta.cs | 6 + .../DocPagesInsertBlank400ResponseCode.cs | 34 + .../DocPagesInsertBlank404ResponseCode.cs | 34 + .../DocPagesMove200ResponseMetaCacheDelta.cs | 6 + .../Types/DocPagesMove400ResponseCode.cs | 30 + .../Types/DocPagesMove404ResponseCode.cs | 30 + ...agesRemoveName200ResponseMetaCacheDelta.cs | 6 + .../DocPagesRemoveName400ResponseCode.cs | 34 + .../DocPagesRemoveName404ResponseCode.cs | 34 + ...DocPagesRotate200ResponseMetaCacheDelta.cs | 6 + .../Types/DocPagesRotate400ResponseCode.cs | 34 + .../Types/DocPagesRotate404ResponseCode.cs | 34 + ...ocPagesSetName200ResponseMetaCacheDelta.cs | 6 + .../Types/DocPagesSetName400ResponseCode.cs | 34 + .../Types/DocPagesSetName404ResponseCode.cs | 34 + ...edactionsApply200ResponseMetaCacheDelta.cs | 6 + .../DocRedactionsApply400ResponseCode.cs | 34 + .../DocRedactionsApply404ResponseCode.cs | 34 + src/CloudPDF/Types/DocRenderResponseCode.cs | 26 + .../Types/DocSignaturesAbort200Response.cs | 28 + .../DocSignaturesAbort200ResponseStatus.cs | 125 +++ .../Types/DocSignaturesAbort404Response.cs | 37 + .../DocSignaturesAbort404ResponseCode.cs | 242 +++++ .../DocSignaturesAbort404ResponseName.cs | 114 +++ .../Types/DocSignaturesAnalysis200Response.cs | 56 ++ .../DocSignaturesAnalysis200ResponseBasis.cs | 34 + ...ignaturesAnalysis200ResponseBasisSource.cs | 128 +++ ...gnaturesAnalysis200ResponseBasisVersion.cs | 31 + ...DocSignaturesAnalysis200ResponseCurrent.cs | 41 + ...sAnalysis200ResponseCurrentFindingsItem.cs | 40 + ...is200ResponseCurrentFindingsItemVerdict.cs | 136 +++ ...naturesAnalysis200ResponseCurrentMethod.cs | 128 +++ ...aturesAnalysis200ResponseCurrentPrimary.cs | 40 + ...nalysis200ResponseCurrentPrimaryVerdict.cs | 136 +++ ...aturesAnalysis200ResponseCurrentVerdict.cs | 140 +++ .../DocSignaturesAnalysis200ResponseLater.cs | 31 + .../DocSignaturesAnalysis200ResponseMode.cs | 124 +++ ...uresAnalysis200ResponseRestrictionsItem.cs | 43 + ...alysis200ResponseRestrictionsItemSource.cs | 136 +++ .../DocSignaturesAnalysis200ResponseSince.cs | 31 + .../DocSignaturesAnalysis200ResponseUntil.cs | 28 + ...DocSignaturesAnalysis200ResponseVerdict.cs | 136 +++ .../Types/DocSignaturesAnalysis400Response.cs | 37 + .../DocSignaturesAnalysis400ResponseCode.cs | 244 +++++ .../DocSignaturesAnalysis400ResponseName.cs | 118 +++ .../Types/DocSignaturesAnalysis404Response.cs | 37 + .../DocSignaturesAnalysis404ResponseCode.cs | 244 +++++ .../DocSignaturesAnalysis404ResponseName.cs | 118 +++ .../Types/DocSignaturesComplete200Response.cs | 43 + .../DocSignaturesComplete200ResponseMeta.cs | 32 + ...omplete200ResponseMetaAffectedPagesItem.cs | 34 + ...00ResponseMetaAffectedPagesItemRevision.cs | 34 + ...etaAffectedPagesItemWeakAnnotationState.cs | 330 +++++++ ...fectedPagesItemWeakAnnotationStateKnown.cs | 29 + ...ctedPagesItemWeakAnnotationStateUnknown.cs | 26 + ...aturesComplete200ResponseMetaCacheDelta.cs | 44 + ...plete200ResponseMetaCacheDeltaPagesItem.cs | 31 + ...200ResponseMetaCacheDeltaPagesItemCache.cs | 31 + ...ocSignaturesComplete200ResponsePrevious.cs | 31 + ...SignaturesComplete200ResponseProtection.cs | 41 + ...plete200ResponseProtectionCertification.cs | 31 + ...esComplete200ResponseProtectionEnforced.cs | 140 +++ ...lete200ResponseProtectionFieldLocksItem.cs | 34 + ...0ResponseProtectionFieldLocksItemSource.cs | 131 +++ ...200ResponseProtectionFieldLocksItemSpec.cs | 34 + ...ponseProtectionFieldLocksItemSpecAction.cs | 140 +++ ...uresComplete200ResponseProtectionJudged.cs | 136 +++ ...cSignaturesComplete200ResponseSignature.cs | 79 ++ ...resComplete200ResponseSignatureCoverage.cs | 136 +++ ...aturesComplete200ResponseSignatureField.cs | 301 +++++++ ...resComplete200ResponseSignatureFieldFqn.cs | 28 + ...resComplete200ResponseSignatureFieldMdp.cs | 34 + ...plete200ResponseSignatureFieldMdpAction.cs | 136 +++ ...te200ResponseSignatureFieldObjectNumber.cs | 28 + ...naturesComplete200ResponseSignatureKind.cs | 128 +++ ...naturesComplete200ResponseSignatureLock.cs | 34 + ...sComplete200ResponseSignatureLockAction.cs | 136 +++ ...esComplete200ResponseSignatureSeedValue.cs | 52 ++ ...turesComplete200ResponseSignatureSigner.cs | 40 + ...turesComplete200ResponseSignatureWidget.cs | 31 + .../DocSignaturesComplete200ResponseStatus.cs | 122 +++ ...DocSignaturesComplete200ResponseVersion.cs | 31 + .../Types/DocSignaturesComplete400Response.cs | 37 + .../DocSignaturesComplete400ResponseCode.cs | 244 +++++ .../DocSignaturesComplete400ResponseName.cs | 118 +++ .../Types/DocSignaturesComplete404Response.cs | 37 + .../DocSignaturesComplete404ResponseCode.cs | 244 +++++ .../DocSignaturesComplete404ResponseName.cs | 118 +++ .../Types/DocSignaturesComplete409Response.cs | 37 + .../DocSignaturesComplete409ResponseCode.cs | 244 +++++ .../DocSignaturesComplete409ResponseName.cs | 118 +++ .../Types/DocSignaturesList200Response.cs | 39 + .../DocSignaturesList200ResponseProtection.cs | 41 + ...sList200ResponseProtectionCertification.cs | 31 + ...aturesList200ResponseProtectionEnforced.cs | 134 +++ ...List200ResponseProtectionFieldLocksItem.cs | 34 + ...0ResponseProtectionFieldLocksItemSource.cs | 132 +++ ...200ResponseProtectionFieldLocksItemSpec.cs | 34 + ...ponseProtectionFieldLocksItemSpecAction.cs | 137 +++ ...gnaturesList200ResponseProtectionJudged.cs | 134 +++ ...cSignaturesList200ResponseRevisionsItem.cs | 37 + ...SignaturesList200ResponseSignaturesItem.cs | 79 ++ ...esList200ResponseSignaturesItemCoverage.cs | 136 +++ ...turesList200ResponseSignaturesItemField.cs | 304 +++++++ ...esList200ResponseSignaturesItemFieldFqn.cs | 28 + ...esList200ResponseSignaturesItemFieldMdp.cs | 34 + ...200ResponseSignaturesItemFieldMdpAction.cs | 136 +++ ...ResponseSignaturesItemFieldObjectNumber.cs | 28 + ...aturesList200ResponseSignaturesItemKind.cs | 128 +++ ...aturesList200ResponseSignaturesItemLock.cs | 34 + ...List200ResponseSignaturesItemLockAction.cs | 136 +++ ...sList200ResponseSignaturesItemSeedValue.cs | 52 ++ ...uresList200ResponseSignaturesItemSigner.cs | 40 + ...uresList200ResponseSignaturesItemWidget.cs | 31 + .../Types/DocSignaturesList404Response.cs | 37 + .../Types/DocSignaturesList404ResponseCode.cs | 238 +++++ .../Types/DocSignaturesList404ResponseName.cs | 112 +++ .../Types/DocSignaturesPrepare200Response.cs | 49 + ...ocSignaturesPrepare200ResponseAlgorithm.cs | 128 +++ ...aturesPrepare200ResponseExpectedVersion.cs | 31 + .../Types/DocSignaturesPrepare400Response.cs | 37 + .../DocSignaturesPrepare400ResponseCode.cs | 243 +++++ .../DocSignaturesPrepare400ResponseName.cs | 117 +++ .../Types/DocSignaturesPrepare404Response.cs | 37 + .../DocSignaturesPrepare404ResponseCode.cs | 243 +++++ .../DocSignaturesPrepare404ResponseName.cs | 117 +++ .../Types/DocSignaturesPrepare409Response.cs | 37 + .../DocSignaturesPrepare409ResponseCode.cs | 243 +++++ .../DocSignaturesPrepare409ResponseName.cs | 117 +++ src/CloudPDF/Types/DocText404ResponseCode.cs | 26 + .../Types/DocVersionsAnalysis200Response.cs | 56 ++ .../DocVersionsAnalysis200ResponseBasis.cs | 34 + ...cVersionsAnalysis200ResponseBasisSource.cs | 128 +++ ...VersionsAnalysis200ResponseBasisVersion.cs | 31 + .../DocVersionsAnalysis200ResponseCurrent.cs | 41 + ...sAnalysis200ResponseCurrentFindingsItem.cs | 40 + ...is200ResponseCurrentFindingsItemVerdict.cs | 135 +++ ...ersionsAnalysis200ResponseCurrentMethod.cs | 128 +++ ...rsionsAnalysis200ResponseCurrentPrimary.cs | 40 + ...nalysis200ResponseCurrentPrimaryVerdict.cs | 136 +++ ...rsionsAnalysis200ResponseCurrentVerdict.cs | 140 +++ .../DocVersionsAnalysis200ResponseLater.cs | 31 + .../DocVersionsAnalysis200ResponseMode.cs | 120 +++ ...ionsAnalysis200ResponseRestrictionsItem.cs | 43 + ...alysis200ResponseRestrictionsItemSource.cs | 136 +++ .../DocVersionsAnalysis200ResponseSince.cs | 31 + .../DocVersionsAnalysis200ResponseUntil.cs | 28 + .../DocVersionsAnalysis200ResponseVerdict.cs | 130 +++ .../Types/DocVersionsAnalysis400Response.cs | 37 + .../DocVersionsAnalysis400ResponseCode.cs | 242 +++++ .../DocVersionsAnalysis400ResponseName.cs | 114 +++ .../Types/DocVersionsAnalysis404Response.cs | 37 + .../DocVersionsAnalysis404ResponseCode.cs | 242 +++++ .../DocVersionsAnalysis404ResponseName.cs | 114 +++ .../Types/DocVersionsDownloadResponse.cs | 37 + .../Types/DocVersionsDownloadResponseCode.cs | 238 +++++ .../Types/DocVersionsDownloadResponseName.cs | 112 +++ .../Types/DocVersionsList200Response.cs | 32 + .../DocVersionsList200ResponseVersionsItem.cs | 46 + ...ionsList200ResponseVersionsItemProducer.cs | 128 +++ .../Types/DocVersionsList404Response.cs | 37 + .../Types/DocVersionsList404ResponseCode.cs | 236 +++++ .../Types/DocVersionsList404ResponseName.cs | 112 +++ .../Types/DocVersionsRevisionResponse.cs | 37 + .../Types/DocVersionsRevisionResponseCode.cs | 238 +++++ .../Types/DocVersionsRevisionResponseName.cs | 112 +++ .../DocVersionsSignatureContentsResponse.cs | 37 + ...ocVersionsSignatureContentsResponseCode.cs | 257 ++++++ ...ocVersionsSignatureContentsResponseName.cs | 122 +++ .../DocVersionsSignatureDigestResponse.cs | 37 + .../DocVersionsSignatureDigestResponseCode.cs | 249 +++++ .../DocVersionsSignatureDigestResponseName.cs | 118 +++ .../Types/DocVersionsSignatures200Response.cs | 39 + ...VersionsSignatures200ResponseProtection.cs | 41 + ...tures200ResponseProtectionCertification.cs | 31 + ...Signatures200ResponseProtectionEnforced.cs | 140 +++ ...ures200ResponseProtectionFieldLocksItem.cs | 34 + ...0ResponseProtectionFieldLocksItemSource.cs | 131 +++ ...200ResponseProtectionFieldLocksItemSpec.cs | 34 + ...ponseProtectionFieldLocksItemSpecAction.cs | 140 +++ ...nsSignatures200ResponseProtectionJudged.cs | 136 +++ ...sionsSignatures200ResponseRevisionsItem.cs | 37 + ...ionsSignatures200ResponseSignaturesItem.cs | 79 ++ ...atures200ResponseSignaturesItemCoverage.cs | 135 +++ ...ignatures200ResponseSignaturesItemField.cs | 310 +++++++ ...atures200ResponseSignaturesItemFieldFqn.cs | 28 + ...atures200ResponseSignaturesItemFieldMdp.cs | 34 + ...200ResponseSignaturesItemFieldMdpAction.cs | 137 +++ ...ResponseSignaturesItemFieldObjectNumber.cs | 28 + ...Signatures200ResponseSignaturesItemKind.cs | 130 +++ ...Signatures200ResponseSignaturesItemLock.cs | 34 + ...ures200ResponseSignaturesItemLockAction.cs | 136 +++ ...tures200ResponseSignaturesItemSeedValue.cs | 52 ++ ...gnatures200ResponseSignaturesItemSigner.cs | 40 + ...gnatures200ResponseSignaturesItemWidget.cs | 31 + .../Types/DocVersionsSignatures404Response.cs | 37 + .../DocVersionsSignatures404ResponseCode.cs | 244 +++++ .../DocVersionsSignatures404ResponseName.cs | 118 +++ src/CloudPDF/Types/EngineErrorPayloadCode.cs | 26 + 324 files changed, 26382 insertions(+), 281 deletions(-) create mode 100644 src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/AbortTest.cs create mode 100644 src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/AnalysisTest.cs create mode 100644 src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/CompleteTest.cs create mode 100644 src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/ListTest.cs create mode 100644 src/CloudPDF.Test/Unit/MockServer/Doc/Versions/AnalysisTest.cs create mode 100644 src/CloudPDF.Test/Unit/MockServer/Doc/Versions/ListTest.cs create mode 100644 src/CloudPDF.Test/Unit/MockServer/Doc/Versions/SignaturesTest.cs create mode 100644 src/CloudPDF/Doc/Signatures/ISignaturesClient.cs create mode 100644 src/CloudPDF/Doc/Signatures/Requests/AbortSignaturesRequest.cs create mode 100644 src/CloudPDF/Doc/Signatures/Requests/AnalysisSignaturesRequest.cs create mode 100644 src/CloudPDF/Doc/Signatures/Requests/DocSignaturesCompleteRequest.cs create mode 100644 src/CloudPDF/Doc/Signatures/Requests/ListSignaturesRequest.cs create mode 100644 src/CloudPDF/Doc/Signatures/Requests/PrepareSignaturesRequest.cs create mode 100644 src/CloudPDF/Doc/Signatures/SignaturesClient.cs create mode 100644 src/CloudPDF/Doc/Signatures/Types/AnalysisSignaturesRequestLevel.cs create mode 100644 src/CloudPDF/Doc/Signatures/Types/DocSignaturesCompleteRequestExpectedVersion.cs create mode 100644 src/CloudPDF/Doc/Versions/IVersionsClient.cs create mode 100644 src/CloudPDF/Doc/Versions/Requests/AnalysisVersionsRequest.cs create mode 100644 src/CloudPDF/Doc/Versions/Requests/DownloadVersionsRequest.cs create mode 100644 src/CloudPDF/Doc/Versions/Requests/ListVersionsRequest.cs create mode 100644 src/CloudPDF/Doc/Versions/Requests/RevisionVersionsRequest.cs create mode 100644 src/CloudPDF/Doc/Versions/Requests/SignatureContentsVersionsRequest.cs create mode 100644 src/CloudPDF/Doc/Versions/Requests/SignatureDigestVersionsRequest.cs create mode 100644 src/CloudPDF/Doc/Versions/Requests/SignaturesVersionsRequest.cs create mode 100644 src/CloudPDF/Doc/Versions/Types/AnalysisVersionsRequestLevel.cs create mode 100644 src/CloudPDF/Doc/Versions/Types/SignatureDigestVersionsRequestAlgorithm.cs create mode 100644 src/CloudPDF/Doc/Versions/VersionsClient.cs delete mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichText.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBody.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyMargins.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItem.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemMargins.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichText.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBody.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyMargins.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItem.cs rename src/CloudPDF/Types/{DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily.cs => DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign.cs} (52%) create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemMargins.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.cs create mode 100644 src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAbort200Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAbort200ResponseStatus.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAbort404Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAbort404ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAbort404ResponseName.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasis.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasisSource.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasisVersion.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrent.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItem.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentMethod.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentPrimary.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentVerdict.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseLater.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseMode.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseRestrictionsItem.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseRestrictionsItemSource.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseSince.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseUntil.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis200ResponseVerdict.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis400Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis400ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis400ResponseName.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis404Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis404ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocSignaturesAnalysis404ResponseName.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseMeta.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItem.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemRevision.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDelta.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItem.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItemCache.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponsePrevious.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseProtection.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionCertification.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionEnforced.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItem.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSource.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSpec.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionJudged.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignature.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureCoverage.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureField.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldFqn.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldMdp.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldMdpAction.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldObjectNumber.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureKind.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureLock.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureLockAction.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureSeedValue.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureSigner.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureWidget.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseStatus.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete200ResponseVersion.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete400Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete400ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete400ResponseName.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete404Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete404ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete404ResponseName.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete409Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete409ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocSignaturesComplete409ResponseName.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseProtection.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseProtectionCertification.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseProtectionEnforced.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItem.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSource.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSpec.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseProtectionJudged.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseRevisionsItem.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItem.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemCoverage.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemField.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldFqn.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldMdp.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldMdpAction.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldObjectNumber.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemKind.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemLock.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemLockAction.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemSeedValue.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemSigner.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemWidget.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList404Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList404ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocSignaturesList404ResponseName.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare200Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare200ResponseAlgorithm.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare200ResponseExpectedVersion.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare400Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare400ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare400ResponseName.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare404Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare404ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare404ResponseName.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare409Response.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare409ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocSignaturesPrepare409ResponseName.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200Response.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasis.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasisSource.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasisVersion.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrent.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentFindingsItem.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentMethod.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentPrimary.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentPrimaryVerdict.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentVerdict.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseLater.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseMode.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseRestrictionsItem.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseRestrictionsItemSource.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseSince.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseUntil.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis200ResponseVerdict.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis400Response.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis400ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis400ResponseName.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis404Response.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis404ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocVersionsAnalysis404ResponseName.cs create mode 100644 src/CloudPDF/Types/DocVersionsDownloadResponse.cs create mode 100644 src/CloudPDF/Types/DocVersionsDownloadResponseCode.cs create mode 100644 src/CloudPDF/Types/DocVersionsDownloadResponseName.cs create mode 100644 src/CloudPDF/Types/DocVersionsList200Response.cs create mode 100644 src/CloudPDF/Types/DocVersionsList200ResponseVersionsItem.cs create mode 100644 src/CloudPDF/Types/DocVersionsList200ResponseVersionsItemProducer.cs create mode 100644 src/CloudPDF/Types/DocVersionsList404Response.cs create mode 100644 src/CloudPDF/Types/DocVersionsList404ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocVersionsList404ResponseName.cs create mode 100644 src/CloudPDF/Types/DocVersionsRevisionResponse.cs create mode 100644 src/CloudPDF/Types/DocVersionsRevisionResponseCode.cs create mode 100644 src/CloudPDF/Types/DocVersionsRevisionResponseName.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatureContentsResponse.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatureContentsResponseCode.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatureContentsResponseName.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatureDigestResponse.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatureDigestResponseCode.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatureDigestResponseName.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200Response.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseProtection.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionCertification.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionEnforced.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItem.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSource.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSpec.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionJudged.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseRevisionsItem.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItem.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemCoverage.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemField.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldFqn.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldMdp.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemKind.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemLock.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemLockAction.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemSeedValue.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemSigner.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemWidget.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures404Response.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures404ResponseCode.cs create mode 100644 src/CloudPDF/Types/DocVersionsSignatures404ResponseName.cs diff --git a/.fern/metadata.json b/.fern/metadata.json index 4c70a72..71a452b 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -10,10 +10,10 @@ "base-exception-class-name": "CloudPDFException", "base-api-exception-class-name": "CloudPDFApiException" }, - "originGitCommit": "b0888bd6ca83627cb07ea05c440e35c183cebbd0", + "originGitCommit": "5f2d480665034420df58c19fd1328b0823104e0f", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0-next.12", + "requestedVersion": "3.0.0-next.13", "ciProvider": "github", - "sdkVersion": "3.0.0-next.12" + "sdkVersion": "3.0.0-next.13" } \ No newline at end of file diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 1faf5bc..8711044 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "csharp", - "canonicalVersion": "3.0.0-next.12", - "sdkVersion": "3.0.0-next.12", + "canonicalVersion": "3.0.0-next.13", + "sdkVersion": "3.0.0-next.13", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "501ec54f2f28089dc8a3cf3a8d2ff3ade44c6c35d47977a3dfa47465fb83a049", - "gitCommit": "b0888bd6ca83627cb07ea05c440e35c183cebbd0", + "openapiSha256": "a472da9c7aed5db7f2b6b1f67f1b6268a9407afe9e7cf879ac04b878b4fc9dc7", + "gitCommit": "5f2d480665034420df58c19fd1328b0823104e0f", "gitCommitIsDirty": false }, "fern": { diff --git a/reference.md b/reference.md index 2d21f95..4d3691a 100644 --- a/reference.md +++ b/reference.md @@ -2549,3 +2549,651 @@ await client.Doc.Redactions.ApplyAsync( +## Doc Signatures +
client.Doc.Signatures.ListAsync(ListSignaturesRequest { ... }) -> WithRawResponseTask<DocSignaturesList200Response> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Describes the bytes the layer is over: the base version's signatures plus the layer's own edits as the last revision. Signed bytes (contents, digests, revision prefixes) are served per base version under /versions. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Signatures.ListAsync( + new ListSignaturesRequest { DocId = "docId", LayerName = "layerName" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ListSignaturesRequest` + +
+
+
+
+ + +
+
+
+ +
client.Doc.Signatures.AbortAsync(AbortSignaturesRequest { ... }) -> WithRawResponseTask<DocSignaturesAbort200Response> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Signatures.AbortAsync( + new AbortSignaturesRequest + { + DocId = "docId", + LayerName = "layerName", + SigningId = "signingId", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `AbortSignaturesRequest` + +
+
+
+
+ + +
+
+
+ +
client.Doc.Signatures.CompleteAsync(DocSignaturesCompleteRequest { ... }) -> WithRawResponseTask<DocSignaturesComplete200Response> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +`cms` is the detached CMS over the prepared digest, base64. `expectedVersion` must be what prepare returned. Idempotent by signing id: the same CMS again answers `already-completed`. Every layer of the document then sits over the new version; refetch the manifest after a completion. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Signatures.CompleteAsync( + new DocSignaturesCompleteRequest + { + DocId = "docId", + LayerName = "layerName", + SigningId = "signingId", + Cms = "cms", + ExpectedVersion = new DocSignaturesCompleteRequestExpectedVersion + { + BaseSha256 = "baseSha256", + EditsVersion = 1, + }, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DocSignaturesCompleteRequest` + +
+
+
+
+ + +
+
+
+ +
client.Doc.Signatures.AnalysisAsync(AnalysisSignaturesRequest { ... }) -> WithRawResponseTask<DocSignaturesAnalysis200Response> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exactly one of `since.signature=` or `since.revision=`; the layer's pending edits are the end. `level=fill|annotate|lta|none` evaluates exploratorily and never becomes a verdict. For history between two base revisions use the version analysis. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Signatures.AnalysisAsync( + new AnalysisSignaturesRequest { DocId = "docId", LayerName = "layerName" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `AnalysisSignaturesRequest` + +
+
+
+
+ + +
+
+
+ +
client.Doc.Signatures.PrepareAsync(PrepareSignaturesRequest { ... }) -> WithRawResponseTask<DocSignaturesPrepare200Response> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The multipart envelope: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock, appearance) and an optional `resource:` PDF part the body's `appearance.resource` names. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is aborted, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Signatures.PrepareAsync( + new PrepareSignaturesRequest { DocId = "docId", LayerName = "layerName" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `PrepareSignaturesRequest` + +
+
+
+
+ + +
+
+
+ +## Doc Versions +
client.Doc.Versions.ListAsync(ListVersionsRequest { ... }) -> WithRawResponseTask<DocVersionsList200Response> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Every completed signature publishes a new version. Never cached: the list grows. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Versions.ListAsync(new ListVersionsRequest { DocId = "docId" }); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `ListVersionsRequest` + +
+
+
+
+ + +
+
+
+ +
client.Doc.Versions.AnalysisAsync(AnalysisVersionsRequest { ... }) -> WithRawResponseTask<DocVersionsAnalysis200Response> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exactly one of `since.signature` / `since.revision`; `until=` defaults to the last. The same answer for every layer and every caller. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Versions.AnalysisAsync( + new AnalysisVersionsRequest { DocId = "docId", Sha = "sha" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `AnalysisVersionsRequest` + +
+
+
+
+ + +
+
+
+ +
client.Doc.Versions.DownloadAsync(DownloadVersionsRequest { ... }) -> WithRawResponseTask<Stream> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Versions.DownloadAsync( + new DownloadVersionsRequest { DocId = "docId", Sha = "sha" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DownloadVersionsRequest` + +
+
+
+
+ + +
+
+
+ +
client.Doc.Versions.RevisionAsync(RevisionVersionsRequest { ... }) -> WithRawResponseTask<Stream> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Versions.RevisionAsync( + new RevisionVersionsRequest + { + DocId = "docId", + Sha = "sha", + Index = 1, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `RevisionVersionsRequest` + +
+
+
+
+ + +
+
+
+ +
client.Doc.Versions.SignaturesAsync(SignaturesVersionsRequest { ... }) -> WithRawResponseTask<DocVersionsSignatures200Response> +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Versions.SignaturesAsync( + new SignaturesVersionsRequest { DocId = "docId", Sha = "sha" } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `SignaturesVersionsRequest` + +
+
+
+
+ + +
+
+
+ +
client.Doc.Versions.SignatureContentsAsync(SignatureContentsVersionsRequest { ... }) -> WithRawResponseTask<Stream> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +`fieldKey` is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Versions.SignatureContentsAsync( + new SignatureContentsVersionsRequest + { + DocId = "docId", + Sha = "sha", + FieldKey = "fieldKey", + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `SignatureContentsVersionsRequest` + +
+
+
+
+ + +
+
+
+ +
client.Doc.Versions.SignatureDigestAsync(SignatureDigestVersionsRequest { ... }) -> WithRawResponseTask<Stream> +
+
+ +#### 📝 Description + +
+
+ +
+
+ +What a CMS verifier compares its message digest to. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```csharp +await client.Doc.Versions.SignatureDigestAsync( + new SignatureDigestVersionsRequest + { + DocId = "docId", + Sha = "sha", + FieldKey = "fieldKey", + Algorithm = SignatureDigestVersionsRequestAlgorithm.Sha1, + } +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `SignatureDigestVersionsRequest` + +
+
+
+
+ + +
+
+
+ diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/CreateTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/CreateTest.cs index 5559150..f3ea7d6 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/CreateTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/CreateTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -135,6 +137,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/DeleteTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/DeleteTest.cs index 04a8e69..2e83689 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/DeleteTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/DeleteTest.cs @@ -43,6 +43,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -113,6 +115,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/FlattenTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/FlattenTest.cs index 8f9288b..f67ce93 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/FlattenTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/FlattenTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -135,6 +137,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/UpdateTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/UpdateTest.cs index 7053572..aff1b13 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/UpdateTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/UpdateTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -136,6 +138,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ImportDataTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ImportDataTest.cs index fd4a3fa..42660fb 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ImportDataTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ImportDataTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -134,6 +136,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ResetTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ResetTest.cs index 326a875..0a5083f 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ResetTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ResetTest.cs @@ -43,6 +43,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -112,6 +114,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/SetValueTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/SetValueTest.cs index f58fd4c..4ca71c1 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/SetValueTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/SetValueTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -135,6 +137,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/ManifestTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/ManifestTest.cs index c83037b..9b5c41e 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/ManifestTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/ManifestTest.cs @@ -22,6 +22,9 @@ public async Task MockServerTest_1() "annotationsVersion": 1, "auditHead": 1, "baseSha": "baseSha", + "layerVersion": 1, + "working": true, + "baseByteLength": 1, "scopes": { "content": "base", "annotations": "base", @@ -102,6 +105,9 @@ public async Task MockServerTest_2() "annotationsVersion": 1, "auditHead": 1, "baseSha": "baseSha", + "layerVersion": 1, + "working": true, + "baseByteLength": 1, "scopes": { "content": "base", "annotations": "base", diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/DeleteTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/DeleteTest.cs index 03e80d4..4c41c80 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/DeleteTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/DeleteTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -134,6 +136,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/FlattenTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/FlattenTest.cs index e88e733..c702391 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/FlattenTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/FlattenTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -134,6 +136,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/InsertBlankTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/InsertBlankTest.cs index 688be7e..9add7ce 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/InsertBlankTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/InsertBlankTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -134,6 +136,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/MoveTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/MoveTest.cs index 9da7144..69da7eb 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/MoveTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/MoveTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -134,6 +136,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RemoveNameTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RemoveNameTest.cs index 743eeb3..0fdd32c 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RemoveNameTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RemoveNameTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -134,6 +136,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RotateTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RotateTest.cs index 844f643..4eb0085 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RotateTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RotateTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -134,6 +136,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetNameTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetNameTest.cs index d6cff01..e68bda0 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetNameTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetNameTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -134,6 +136,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Redactions/ApplyTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Redactions/ApplyTest.cs index 5d41d14..d419579 100644 --- a/src/CloudPDF.Test/Unit/MockServer/Doc/Redactions/ApplyTest.cs +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Redactions/ApplyTest.cs @@ -51,6 +51,8 @@ public async Task MockServerTest_1() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, @@ -134,6 +136,8 @@ public async Task MockServerTest_2() "previousDocVersion": 1, "docVersion": 1, "annotationsVersion": 1, + "layerVersion": 1, + "working": true, "pages": [ { "pageObjectNumber": 1, diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/AbortTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/AbortTest.cs new file mode 100644 index 0000000..72b5539 --- /dev/null +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/AbortTest.cs @@ -0,0 +1,79 @@ +using CloudPDF.Doc; +using CloudPDF.Test.Unit.MockServer; +using CloudPDF.Test.Utils; +using NUnit.Framework; + +namespace CloudPDF.Test.Unit.MockServer.Doc.Signatures; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class AbortTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "status": "aborted" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/layers/layerName/signatures/signingId") + .UsingDelete() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Signatures.AbortAsync( + new AbortSignaturesRequest + { + DocId = "docId", + LayerName = "layerName", + SigningId = "signingId", + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "status": "aborted" + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/layers/layerName/signatures/signingId") + .UsingDelete() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Signatures.AbortAsync( + new AbortSignaturesRequest + { + DocId = "docId", + LayerName = "layerName", + SigningId = "signingId", + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/AnalysisTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/AnalysisTest.cs new file mode 100644 index 0000000..6dec723 --- /dev/null +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/AnalysisTest.cs @@ -0,0 +1,210 @@ +using CloudPDF.Doc; +using CloudPDF.Test.Unit.MockServer; +using CloudPDF.Test.Utils; +using NUnit.Framework; + +namespace CloudPDF.Test.Unit.MockServer.Doc.Signatures; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class AnalysisTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "mode": "authoritative", + "policyVersion": 1, + "basis": { + "version": { + "sha256": "sha256", + "byteLength": 1 + }, + "editsVersion": 1, + "source": "persisted" + }, + "since": { + "revisionIndex": 1, + "signatureIndex": 1 + }, + "until": { + "revisionIndex": 1 + }, + "restrictions": [ + { + "signatureIndex": 1, + "revisionIndex": 1, + "source": "docmdp", + "own": true, + "permission": 1.1, + "fields": { + "key": "value" + } + }, + { + "signatureIndex": 1, + "revisionIndex": 1, + "source": "docmdp", + "own": true, + "permission": 1.1, + "fields": { + "key": "value" + } + } + ], + "current": { + "verdict": "unchanged", + "complete": true, + "primary": { + "rule": "rule", + "verdict": "permitted", + "objectNumber": 1, + "edge": "edge", + "detail": "detail" + }, + "findings": [ + { + "rule": "rule", + "verdict": "permitted", + "objectNumber": 1, + "edge": "edge", + "detail": "detail" + }, + { + "rule": "rule", + "verdict": "permitted", + "objectNumber": 1, + "edge": "edge", + "detail": "detail" + } + ], + "method": "net-state" + }, + "later": { + "revisionCount": 1, + "undoneObjectNumbers": [ + 1, + 1 + ] + }, + "verdict": "unchanged", + "steps": [ + { + "key": "value" + }, + { + "key": "value" + } + ] + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/layers/layerName/signatures/analysis") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Signatures.AnalysisAsync( + new AnalysisSignaturesRequest { DocId = "docId", LayerName = "layerName" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "mode": "authoritative", + "policyVersion": 1, + "basis": { + "version": { + "sha256": "sha256", + "byteLength": 1 + }, + "editsVersion": 1, + "source": "persisted" + }, + "since": { + "revisionIndex": 1, + "signatureIndex": 1 + }, + "until": { + "revisionIndex": 1 + }, + "restrictions": [ + { + "signatureIndex": 1, + "revisionIndex": 1, + "source": "docmdp", + "own": true, + "permission": 1.1, + "fields": { + "key": "value" + } + } + ], + "current": { + "verdict": "unchanged", + "complete": true, + "primary": { + "rule": "rule", + "verdict": "permitted", + "objectNumber": 1, + "edge": "edge", + "detail": "detail" + }, + "findings": [ + { + "rule": "rule", + "verdict": "permitted", + "objectNumber": 1 + } + ], + "method": "net-state" + }, + "later": { + "revisionCount": 1, + "undoneObjectNumbers": [ + 1 + ] + }, + "verdict": "unchanged", + "steps": [ + { + "key": "value" + } + ] + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/layers/layerName/signatures/analysis") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Signatures.AnalysisAsync( + new AnalysisSignaturesRequest { DocId = "docId", LayerName = "layerName" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/CompleteTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/CompleteTest.cs new file mode 100644 index 0000000..76f278d --- /dev/null +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/CompleteTest.cs @@ -0,0 +1,397 @@ +using CloudPDF.Doc; +using CloudPDF.Test.Unit.MockServer; +using CloudPDF.Test.Utils; +using NUnit.Framework; + +namespace CloudPDF.Test.Unit.MockServer.Doc.Signatures; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class CompleteTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string requestJson = """ + { + "cms": "cms", + "expectedVersion": { + "baseSha256": "baseSha256", + "editsVersion": 1 + } + } + """; + + const string mockResponse = """ + { + "status": "completed", + "signature": { + "index": 1, + "field": { + "kind": "objectNumber", + "fieldObjectNumber": 1 + }, + "fieldName": "fieldName", + "widget": { + "annotObjectNumber": 1, + "pageObjectNumber": 1 + }, + "signed": true, + "kind": "signature", + "filter": "filter", + "subFilter": "subFilter", + "byteRange": [ + { + "key": "value" + }, + { + "key": "value" + } + ], + "contentsSize": 1, + "coverage": "whole-revision", + "revisionIndex": 1, + "signer": { + "name": "name", + "reason": "reason", + "location": "location", + "contactInfo": "contactInfo", + "claimedTime": "claimedTime" + }, + "docMdp": 1.1, + "catalogCertification": true, + "fieldMdp": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + }, + "lock": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + }, + "seedValue": { + "requiredFlags": 1, + "presentFlags": 1, + "version": 1, + "mdp": 1.1, + "filter": "filter", + "subFilters": [ + "subFilters", + "subFilters" + ], + "digestMethods": [ + "digestMethods", + "digestMethods" + ], + "reasons": [ + "reasons", + "reasons" + ], + "unsupportedRequired": true + } + }, + "version": { + "sha256": "sha256", + "byteLength": 1 + }, + "previous": { + "baseSha256": "baseSha256", + "editsVersion": 1 + }, + "protection": { + "enforced": "none", + "judged": "none", + "certification": { + "signatureIndex": 1, + "permission": 1.1 + }, + "fieldLocks": [ + { + "signatureIndex": 1, + "source": "fieldmdp", + "spec": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + } + }, + { + "signatureIndex": 1, + "source": "fieldmdp", + "spec": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + } + } + ], + "policyVersion": 1 + }, + "meta": { + "affectedPages": [ + { + "pageObjectNumber": 1, + "revision": { + "docSessionId": "docSessionId", + "pageObjectNumber": 1, + "generation": 1 + }, + "weakAnnotationState": { + "kind": "unknown" + } + }, + { + "pageObjectNumber": 1, + "revision": { + "docSessionId": "docSessionId", + "pageObjectNumber": 1, + "generation": 1 + }, + "weakAnnotationState": { + "kind": "unknown" + } + } + ], + "cacheDelta": { + "previousDocVersion": 1, + "docVersion": 1, + "annotationsVersion": 1, + "layerVersion": 1, + "working": true, + "pages": [ + { + "pageObjectNumber": 1, + "cache": { + "contentVersion": 1, + "annotationVersion": 1 + } + }, + { + "pageObjectNumber": 1, + "cache": { + "contentVersion": 1, + "annotationVersion": 1 + } + } + ] + } + } + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/layers/layerName/signatures/signingId/complete") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Signatures.CompleteAsync( + new DocSignaturesCompleteRequest + { + DocId = "docId", + LayerName = "layerName", + SigningId = "signingId", + Cms = "cms", + ExpectedVersion = new DocSignaturesCompleteRequestExpectedVersion + { + BaseSha256 = "baseSha256", + EditsVersion = 1, + }, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string requestJson = """ + { + "cms": "cms", + "expectedVersion": { + "baseSha256": "baseSha256", + "editsVersion": 1 + } + } + """; + + const string mockResponse = """ + { + "status": "completed", + "signature": { + "index": 1, + "field": { + "kind": "objectNumber", + "fieldObjectNumber": 1 + }, + "fieldName": "fieldName", + "widget": { + "annotObjectNumber": 1, + "pageObjectNumber": 1 + }, + "signed": true, + "kind": "signature", + "filter": "filter", + "subFilter": "subFilter", + "byteRange": [ + { + "key": "value" + } + ], + "contentsSize": 1, + "coverage": "whole-revision", + "revisionIndex": 1, + "signer": { + "name": "name", + "reason": "reason", + "location": "location", + "contactInfo": "contactInfo", + "claimedTime": "claimedTime" + }, + "docMdp": 1.1, + "catalogCertification": true, + "fieldMdp": { + "action": "all", + "fields": [ + "fields" + ], + "permission": 1.1 + }, + "lock": { + "action": "all", + "fields": [ + "fields" + ], + "permission": 1.1 + }, + "seedValue": { + "requiredFlags": 1, + "presentFlags": 1, + "version": 1, + "mdp": 1.1, + "filter": "filter", + "subFilters": [ + "subFilters" + ], + "digestMethods": [ + "digestMethods" + ], + "reasons": [ + "reasons" + ], + "unsupportedRequired": true + } + }, + "version": { + "sha256": "sha256", + "byteLength": 1 + }, + "previous": { + "baseSha256": "baseSha256", + "editsVersion": 1 + }, + "protection": { + "enforced": "none", + "judged": "none", + "certification": { + "signatureIndex": 1, + "permission": 1.1 + }, + "fieldLocks": [ + { + "signatureIndex": 1, + "source": "fieldmdp" + } + ], + "policyVersion": 1 + }, + "meta": { + "affectedPages": [ + { + "pageObjectNumber": 1, + "revision": { + "docSessionId": "docSessionId", + "pageObjectNumber": 1, + "generation": 1 + }, + "weakAnnotationState": { + "kind": "unknown" + } + } + ], + "cacheDelta": { + "previousDocVersion": 1, + "docVersion": 1, + "annotationsVersion": 1, + "layerVersion": 1, + "working": true, + "pages": [ + { + "pageObjectNumber": 1, + "cache": { + "contentVersion": 1, + "annotationVersion": 1 + } + } + ] + } + } + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/layers/layerName/signatures/signingId/complete") + .WithHeader("Content-Type", "application/json") + .UsingPost() + .WithBodyAsJson(requestJson) + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Signatures.CompleteAsync( + new DocSignaturesCompleteRequest + { + DocId = "docId", + LayerName = "layerName", + SigningId = "signingId", + Cms = "cms", + ExpectedVersion = new DocSignaturesCompleteRequestExpectedVersion + { + BaseSha256 = "baseSha256", + EditsVersion = 1, + }, + } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/ListTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/ListTest.cs new file mode 100644 index 0000000..0b6c66c --- /dev/null +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/ListTest.cs @@ -0,0 +1,338 @@ +using CloudPDF.Doc; +using CloudPDF.Test.Unit.MockServer; +using CloudPDF.Test.Utils; +using NUnit.Framework; + +namespace CloudPDF.Test.Unit.MockServer.Doc.Signatures; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class ListTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "chainValid": true, + "revisions": [ + { + "index": 1, + "end": 1, + "xrefOffset": 1, + "signatureIndex": 1 + }, + { + "index": 1, + "end": 1, + "xrefOffset": 1, + "signatureIndex": 1 + } + ], + "signatures": [ + { + "index": 1, + "field": { + "kind": "objectNumber", + "fieldObjectNumber": 1 + }, + "fieldName": "fieldName", + "widget": { + "annotObjectNumber": 1, + "pageObjectNumber": 1 + }, + "signed": true, + "kind": "signature", + "filter": "filter", + "subFilter": "subFilter", + "byteRange": [ + { + "key": "value" + }, + { + "key": "value" + } + ], + "contentsSize": 1, + "coverage": "whole-revision", + "revisionIndex": 1, + "signer": { + "name": "name", + "reason": "reason", + "location": "location", + "contactInfo": "contactInfo", + "claimedTime": "claimedTime" + }, + "docMdp": 1.1, + "catalogCertification": true, + "fieldMdp": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + }, + "lock": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + }, + "seedValue": { + "requiredFlags": 1, + "presentFlags": 1, + "version": 1, + "mdp": 1.1, + "filter": "filter", + "subFilters": [ + "subFilters", + "subFilters" + ], + "digestMethods": [ + "digestMethods", + "digestMethods" + ], + "reasons": [ + "reasons", + "reasons" + ], + "unsupportedRequired": true + } + }, + { + "index": 1, + "field": { + "kind": "objectNumber", + "fieldObjectNumber": 1 + }, + "fieldName": "fieldName", + "widget": { + "annotObjectNumber": 1, + "pageObjectNumber": 1 + }, + "signed": true, + "kind": "signature", + "filter": "filter", + "subFilter": "subFilter", + "byteRange": [ + { + "key": "value" + }, + { + "key": "value" + } + ], + "contentsSize": 1, + "coverage": "whole-revision", + "revisionIndex": 1, + "signer": { + "name": "name", + "reason": "reason", + "location": "location", + "contactInfo": "contactInfo", + "claimedTime": "claimedTime" + }, + "docMdp": 1.1, + "catalogCertification": true, + "fieldMdp": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + }, + "lock": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + }, + "seedValue": { + "requiredFlags": 1, + "presentFlags": 1, + "version": 1, + "mdp": 1.1, + "filter": "filter", + "subFilters": [ + "subFilters", + "subFilters" + ], + "digestMethods": [ + "digestMethods", + "digestMethods" + ], + "reasons": [ + "reasons", + "reasons" + ], + "unsupportedRequired": true + } + } + ], + "protection": { + "enforced": "none", + "judged": "none", + "certification": { + "signatureIndex": 1, + "permission": 1.1 + }, + "fieldLocks": [ + { + "signatureIndex": 1, + "source": "fieldmdp", + "spec": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + } + }, + { + "signatureIndex": 1, + "source": "fieldmdp", + "spec": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + } + } + ], + "policyVersion": 1 + } + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/layers/layerName/signatures") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Signatures.ListAsync( + new ListSignaturesRequest { DocId = "docId", LayerName = "layerName" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "chainValid": true, + "revisions": [ + { + "index": 1, + "end": 1, + "xrefOffset": 1, + "signatureIndex": 1 + } + ], + "signatures": [ + { + "index": 1, + "field": { + "kind": "objectNumber", + "fieldObjectNumber": 1 + }, + "fieldName": "fieldName", + "widget": { + "annotObjectNumber": 1, + "pageObjectNumber": 1 + }, + "signed": true, + "kind": "signature", + "filter": "filter", + "subFilter": "subFilter", + "byteRange": [], + "contentsSize": 1, + "coverage": "whole-revision", + "revisionIndex": 1, + "signer": {}, + "docMdp": 1.1, + "catalogCertification": true, + "fieldMdp": { + "action": "all", + "fields": [ + "fields" + ] + }, + "lock": { + "action": "all", + "fields": [ + "fields" + ] + }, + "seedValue": { + "requiredFlags": 1, + "presentFlags": 1, + "subFilters": [ + "subFilters" + ], + "digestMethods": [ + "digestMethods" + ], + "reasons": [ + "reasons" + ], + "unsupportedRequired": true + } + } + ], + "protection": { + "enforced": "none", + "judged": "none", + "certification": { + "signatureIndex": 1, + "permission": 1.1 + }, + "fieldLocks": [ + { + "signatureIndex": 1, + "source": "fieldmdp" + } + ], + "policyVersion": 1 + } + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/layers/layerName/signatures") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Signatures.ListAsync( + new ListSignaturesRequest { DocId = "docId", LayerName = "layerName" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Versions/AnalysisTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Versions/AnalysisTest.cs new file mode 100644 index 0000000..9f57705 --- /dev/null +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Versions/AnalysisTest.cs @@ -0,0 +1,210 @@ +using CloudPDF.Doc; +using CloudPDF.Test.Unit.MockServer; +using CloudPDF.Test.Utils; +using NUnit.Framework; + +namespace CloudPDF.Test.Unit.MockServer.Doc.Versions; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class AnalysisTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "mode": "authoritative", + "policyVersion": 1, + "basis": { + "version": { + "sha256": "sha256", + "byteLength": 1 + }, + "editsVersion": 1, + "source": "persisted" + }, + "since": { + "revisionIndex": 1, + "signatureIndex": 1 + }, + "until": { + "revisionIndex": 1 + }, + "restrictions": [ + { + "signatureIndex": 1, + "revisionIndex": 1, + "source": "docmdp", + "own": true, + "permission": 1.1, + "fields": { + "key": "value" + } + }, + { + "signatureIndex": 1, + "revisionIndex": 1, + "source": "docmdp", + "own": true, + "permission": 1.1, + "fields": { + "key": "value" + } + } + ], + "current": { + "verdict": "unchanged", + "complete": true, + "primary": { + "rule": "rule", + "verdict": "permitted", + "objectNumber": 1, + "edge": "edge", + "detail": "detail" + }, + "findings": [ + { + "rule": "rule", + "verdict": "permitted", + "objectNumber": 1, + "edge": "edge", + "detail": "detail" + }, + { + "rule": "rule", + "verdict": "permitted", + "objectNumber": 1, + "edge": "edge", + "detail": "detail" + } + ], + "method": "net-state" + }, + "later": { + "revisionCount": 1, + "undoneObjectNumbers": [ + 1, + 1 + ] + }, + "verdict": "unchanged", + "steps": [ + { + "key": "value" + }, + { + "key": "value" + } + ] + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/versions/analysis/sha") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Versions.AnalysisAsync( + new AnalysisVersionsRequest { DocId = "docId", Sha = "sha" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "mode": "authoritative", + "policyVersion": 1, + "basis": { + "version": { + "sha256": "sha256", + "byteLength": 1 + }, + "editsVersion": 1, + "source": "persisted" + }, + "since": { + "revisionIndex": 1, + "signatureIndex": 1 + }, + "until": { + "revisionIndex": 1 + }, + "restrictions": [ + { + "signatureIndex": 1, + "revisionIndex": 1, + "source": "docmdp", + "own": true, + "permission": 1.1, + "fields": { + "key": "value" + } + } + ], + "current": { + "verdict": "unchanged", + "complete": true, + "primary": { + "rule": "rule", + "verdict": "permitted", + "objectNumber": 1, + "edge": "edge", + "detail": "detail" + }, + "findings": [ + { + "rule": "rule", + "verdict": "permitted", + "objectNumber": 1 + } + ], + "method": "net-state" + }, + "later": { + "revisionCount": 1, + "undoneObjectNumbers": [ + 1 + ] + }, + "verdict": "unchanged", + "steps": [ + { + "key": "value" + } + ] + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/versions/analysis/sha") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Versions.AnalysisAsync( + new AnalysisVersionsRequest { DocId = "docId", Sha = "sha" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Versions/ListTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Versions/ListTest.cs new file mode 100644 index 0000000..cabd317 --- /dev/null +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Versions/ListTest.cs @@ -0,0 +1,100 @@ +using CloudPDF.Doc; +using CloudPDF.Test.Unit.MockServer; +using CloudPDF.Test.Utils; +using NUnit.Framework; + +namespace CloudPDF.Test.Unit.MockServer.Doc.Versions; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class ListTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "head": "head", + "versions": [ + { + "sha256": "sha256", + "byteLength": 1, + "number": 1, + "parentSha256": "parentSha256", + "producer": "upload", + "signingId": "signingId", + "createdAt": 1 + }, + { + "sha256": "sha256", + "byteLength": 1, + "number": 1, + "parentSha256": "parentSha256", + "producer": "upload", + "signingId": "signingId", + "createdAt": 1 + } + ] + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/versions") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Versions.ListAsync( + new ListVersionsRequest { DocId = "docId" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "head": "head", + "versions": [ + { + "sha256": "sha256", + "byteLength": 1, + "number": 1, + "parentSha256": "parentSha256", + "producer": "upload", + "signingId": "signingId", + "createdAt": 1 + } + ] + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/versions") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Versions.ListAsync( + new ListVersionsRequest { DocId = "docId" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Versions/SignaturesTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Versions/SignaturesTest.cs new file mode 100644 index 0000000..e59593d --- /dev/null +++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Versions/SignaturesTest.cs @@ -0,0 +1,338 @@ +using CloudPDF.Doc; +using CloudPDF.Test.Unit.MockServer; +using CloudPDF.Test.Utils; +using NUnit.Framework; + +namespace CloudPDF.Test.Unit.MockServer.Doc.Versions; + +[TestFixture] +[Parallelizable(ParallelScope.Self)] +public class SignaturesTest : BaseMockServerTest +{ + [NUnit.Framework.Test] + public async Task MockServerTest_1() + { + const string mockResponse = """ + { + "chainValid": true, + "revisions": [ + { + "index": 1, + "end": 1, + "xrefOffset": 1, + "signatureIndex": 1 + }, + { + "index": 1, + "end": 1, + "xrefOffset": 1, + "signatureIndex": 1 + } + ], + "signatures": [ + { + "index": 1, + "field": { + "kind": "objectNumber", + "fieldObjectNumber": 1 + }, + "fieldName": "fieldName", + "widget": { + "annotObjectNumber": 1, + "pageObjectNumber": 1 + }, + "signed": true, + "kind": "signature", + "filter": "filter", + "subFilter": "subFilter", + "byteRange": [ + { + "key": "value" + }, + { + "key": "value" + } + ], + "contentsSize": 1, + "coverage": "whole-revision", + "revisionIndex": 1, + "signer": { + "name": "name", + "reason": "reason", + "location": "location", + "contactInfo": "contactInfo", + "claimedTime": "claimedTime" + }, + "docMdp": 1.1, + "catalogCertification": true, + "fieldMdp": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + }, + "lock": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + }, + "seedValue": { + "requiredFlags": 1, + "presentFlags": 1, + "version": 1, + "mdp": 1.1, + "filter": "filter", + "subFilters": [ + "subFilters", + "subFilters" + ], + "digestMethods": [ + "digestMethods", + "digestMethods" + ], + "reasons": [ + "reasons", + "reasons" + ], + "unsupportedRequired": true + } + }, + { + "index": 1, + "field": { + "kind": "objectNumber", + "fieldObjectNumber": 1 + }, + "fieldName": "fieldName", + "widget": { + "annotObjectNumber": 1, + "pageObjectNumber": 1 + }, + "signed": true, + "kind": "signature", + "filter": "filter", + "subFilter": "subFilter", + "byteRange": [ + { + "key": "value" + }, + { + "key": "value" + } + ], + "contentsSize": 1, + "coverage": "whole-revision", + "revisionIndex": 1, + "signer": { + "name": "name", + "reason": "reason", + "location": "location", + "contactInfo": "contactInfo", + "claimedTime": "claimedTime" + }, + "docMdp": 1.1, + "catalogCertification": true, + "fieldMdp": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + }, + "lock": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + }, + "seedValue": { + "requiredFlags": 1, + "presentFlags": 1, + "version": 1, + "mdp": 1.1, + "filter": "filter", + "subFilters": [ + "subFilters", + "subFilters" + ], + "digestMethods": [ + "digestMethods", + "digestMethods" + ], + "reasons": [ + "reasons", + "reasons" + ], + "unsupportedRequired": true + } + } + ], + "protection": { + "enforced": "none", + "judged": "none", + "certification": { + "signatureIndex": 1, + "permission": 1.1 + }, + "fieldLocks": [ + { + "signatureIndex": 1, + "source": "fieldmdp", + "spec": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + } + }, + { + "signatureIndex": 1, + "source": "fieldmdp", + "spec": { + "action": "all", + "fields": [ + "fields", + "fields" + ], + "permission": 1.1 + } + } + ], + "policyVersion": 1 + } + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/versions/signatures/sha") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Versions.SignaturesAsync( + new SignaturesVersionsRequest { DocId = "docId", Sha = "sha" } + ); + JsonAssert.AreEqual(response, mockResponse); + } + + [NUnit.Framework.Test] + public async Task MockServerTest_2() + { + const string mockResponse = """ + { + "chainValid": true, + "revisions": [ + { + "index": 1, + "end": 1, + "xrefOffset": 1, + "signatureIndex": 1 + } + ], + "signatures": [ + { + "index": 1, + "field": { + "kind": "objectNumber", + "fieldObjectNumber": 1 + }, + "fieldName": "fieldName", + "widget": { + "annotObjectNumber": 1, + "pageObjectNumber": 1 + }, + "signed": true, + "kind": "signature", + "filter": "filter", + "subFilter": "subFilter", + "byteRange": [], + "contentsSize": 1, + "coverage": "whole-revision", + "revisionIndex": 1, + "signer": {}, + "docMdp": 1.1, + "catalogCertification": true, + "fieldMdp": { + "action": "all", + "fields": [ + "fields" + ] + }, + "lock": { + "action": "all", + "fields": [ + "fields" + ] + }, + "seedValue": { + "requiredFlags": 1, + "presentFlags": 1, + "subFilters": [ + "subFilters" + ], + "digestMethods": [ + "digestMethods" + ], + "reasons": [ + "reasons" + ], + "unsupportedRequired": true + } + } + ], + "protection": { + "enforced": "none", + "judged": "none", + "certification": { + "signatureIndex": 1, + "permission": 1.1 + }, + "fieldLocks": [ + { + "signatureIndex": 1, + "source": "fieldmdp" + } + ], + "policyVersion": 1 + } + } + """; + + Server + .Given( + WireMock + .RequestBuilders.Request.Create() + .WithPath("/v1/docs/docId/versions/signatures/sha") + .UsingGet() + ) + .RespondWith( + WireMock + .ResponseBuilders.Response.Create() + .WithStatusCode(200) + .WithBody(mockResponse) + ); + + var response = await Client.Doc.Versions.SignaturesAsync( + new SignaturesVersionsRequest { DocId = "docId", Sha = "sha" } + ); + JsonAssert.AreEqual(response, mockResponse); + } +} diff --git a/src/CloudPDF/CloudPDF.csproj b/src/CloudPDF/CloudPDF.csproj index d44fbe0..afa16aa 100644 --- a/src/CloudPDF/CloudPDF.csproj +++ b/src/CloudPDF/CloudPDF.csproj @@ -11,7 +11,7 @@ enable 12 enable - 3.0.0-next.12 + 3.0.0-next.13 3.0.0.0 3.0.0.0 README.md diff --git a/src/CloudPDF/Core/Public/Version.cs b/src/CloudPDF/Core/Public/Version.cs index e88e5c3..a9cfc6d 100644 --- a/src/CloudPDF/Core/Public/Version.cs +++ b/src/CloudPDF/Core/Public/Version.cs @@ -3,5 +3,5 @@ namespace CloudPDF; [Serializable] internal class Version { - public const string Current = "3.0.0-next.12"; + public const string Current = "3.0.0-next.13"; } diff --git a/src/CloudPDF/Doc/DocClient.cs b/src/CloudPDF/Doc/DocClient.cs index 495635e..82d628a 100644 --- a/src/CloudPDF/Doc/DocClient.cs +++ b/src/CloudPDF/Doc/DocClient.cs @@ -16,6 +16,8 @@ internal DocClient(RawClient client) Metadata = new MetadataClient(_client); Pages = new PagesClient(_client); Redactions = new RedactionsClient(_client); + Signatures = new SignaturesClient(_client); + Versions = new VersionsClient(_client); } public IAnnotationsClient Annotations { get; } @@ -28,6 +30,10 @@ internal DocClient(RawClient client) public IRedactionsClient Redactions { get; } + public ISignaturesClient Signatures { get; } + + public IVersionsClient Versions { get; } + private async Task> HeadAsyncCore( HeadDocRequest request, RequestOptions? options = null, diff --git a/src/CloudPDF/Doc/IDocClient.cs b/src/CloudPDF/Doc/IDocClient.cs index 481ce24..4a23c42 100644 --- a/src/CloudPDF/Doc/IDocClient.cs +++ b/src/CloudPDF/Doc/IDocClient.cs @@ -9,6 +9,8 @@ public partial interface IDocClient public IMetadataClient Metadata { get; } public IPagesClient Pages { get; } public IRedactionsClient Redactions { get; } + public ISignaturesClient Signatures { get; } + public IVersionsClient Versions { get; } WithRawResponseTask HeadAsync( HeadDocRequest request, RequestOptions? options = null, diff --git a/src/CloudPDF/Doc/Signatures/ISignaturesClient.cs b/src/CloudPDF/Doc/Signatures/ISignaturesClient.cs new file mode 100644 index 0000000..aa63a1b --- /dev/null +++ b/src/CloudPDF/Doc/Signatures/ISignaturesClient.cs @@ -0,0 +1,48 @@ +using CloudPDF; + +namespace CloudPDF.Doc; + +public partial interface ISignaturesClient +{ + /// + /// Describes the bytes the layer is over: the base version's signatures plus the layer's own edits as the last revision. Signed bytes (contents, digests, revision prefixes) are served per base version under /versions. + /// + WithRawResponseTask ListAsync( + ListSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask AbortAsync( + AbortSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// `cms` is the detached CMS over the prepared digest, base64. `expectedVersion` must be what prepare returned. Idempotent by signing id: the same CMS again answers `already-completed`. Every layer of the document then sits over the new version; refetch the manifest after a completion. + /// + WithRawResponseTask CompleteAsync( + DocSignaturesCompleteRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Exactly one of `since.signature=<index>` or `since.revision=<index>`; the layer's pending edits are the end. `level=fill|annotate|lta|none` evaluates exploratorily and never becomes a verdict. For history between two base revisions use the version analysis. + /// + WithRawResponseTask AnalysisAsync( + AnalysisSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// The multipart envelope: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock, appearance) and an optional `resource:<key>` PDF part the body's `appearance.resource` names. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is aborted, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). + /// + WithRawResponseTask PrepareAsync( + PrepareSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); +} diff --git a/src/CloudPDF/Doc/Signatures/Requests/AbortSignaturesRequest.cs b/src/CloudPDF/Doc/Signatures/Requests/AbortSignaturesRequest.cs new file mode 100644 index 0000000..b098d52 --- /dev/null +++ b/src/CloudPDF/Doc/Signatures/Requests/AbortSignaturesRequest.cs @@ -0,0 +1,29 @@ +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record AbortSignaturesRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + [JsonIgnore] + public required string LayerName { get; set; } + + [JsonIgnore] + public required string SigningId { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Signatures/Requests/AnalysisSignaturesRequest.cs b/src/CloudPDF/Doc/Signatures/Requests/AnalysisSignaturesRequest.cs new file mode 100644 index 0000000..fb48cf0 --- /dev/null +++ b/src/CloudPDF/Doc/Signatures/Requests/AnalysisSignaturesRequest.cs @@ -0,0 +1,35 @@ +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record AnalysisSignaturesRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + [JsonIgnore] + public required string LayerName { get; set; } + + [JsonIgnore] + public int? SinceSignature { get; set; } + + [JsonIgnore] + public int? SinceRevision { get; set; } + + [JsonIgnore] + public AnalysisSignaturesRequestLevel? Level { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Signatures/Requests/DocSignaturesCompleteRequest.cs b/src/CloudPDF/Doc/Signatures/Requests/DocSignaturesCompleteRequest.cs new file mode 100644 index 0000000..14d79db --- /dev/null +++ b/src/CloudPDF/Doc/Signatures/Requests/DocSignaturesCompleteRequest.cs @@ -0,0 +1,35 @@ +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record DocSignaturesCompleteRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + [JsonIgnore] + public required string LayerName { get; set; } + + [JsonIgnore] + public required string SigningId { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + [JsonPropertyName("cms")] + public required string Cms { get; set; } + + [JsonPropertyName("expectedVersion")] + public required DocSignaturesCompleteRequestExpectedVersion ExpectedVersion { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Signatures/Requests/ListSignaturesRequest.cs b/src/CloudPDF/Doc/Signatures/Requests/ListSignaturesRequest.cs new file mode 100644 index 0000000..36db9a2 --- /dev/null +++ b/src/CloudPDF/Doc/Signatures/Requests/ListSignaturesRequest.cs @@ -0,0 +1,26 @@ +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record ListSignaturesRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + [JsonIgnore] + public required string LayerName { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Signatures/Requests/PrepareSignaturesRequest.cs b/src/CloudPDF/Doc/Signatures/Requests/PrepareSignaturesRequest.cs new file mode 100644 index 0000000..5001b79 --- /dev/null +++ b/src/CloudPDF/Doc/Signatures/Requests/PrepareSignaturesRequest.cs @@ -0,0 +1,29 @@ +using CloudPDF; +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record PrepareSignaturesRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + [JsonIgnore] + public required string LayerName { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + public required FileParameter File { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Signatures/SignaturesClient.cs b/src/CloudPDF/Doc/Signatures/SignaturesClient.cs new file mode 100644 index 0000000..bfe2fe7 --- /dev/null +++ b/src/CloudPDF/Doc/Signatures/SignaturesClient.cs @@ -0,0 +1,739 @@ +using CloudPDF; +using CloudPDF.Core; +using global::System.Text.Json; + +namespace CloudPDF.Doc; + +public partial class SignaturesClient : ISignaturesClient +{ + private readonly RawClient _client; + + internal SignaturesClient(RawClient client) + { + _client = client; + } + + private async Task> ListAsyncCore( + ListSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/docs/{0}/layers/{1}/signatures", + ValueConvert.ToPathParameterString(request.DocId), + ValueConvert.ToPathParameterString(request.LayerName) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CloudPDFApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> AbortAsyncCore( + AbortSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Delete, + Path = string.Format( + "v1/docs/{0}/layers/{1}/signatures/{2}", + ValueConvert.ToPathParameterString(request.DocId), + ValueConvert.ToPathParameterString(request.LayerName), + ValueConvert.ToPathParameterString(request.SigningId) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CloudPDFApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> CompleteAsyncCore( + DocSignaturesCompleteRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Post, + Path = string.Format( + "v1/docs/{0}/layers/{1}/signatures/{2}/complete", + ValueConvert.ToPathParameterString(request.DocId), + ValueConvert.ToPathParameterString(request.LayerName), + ValueConvert.ToPathParameterString(request.SigningId) + ), + Body = request, + QueryString = _queryString, + Headers = _headers, + ContentType = "application/json", + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CloudPDFApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 409: + throw new ConflictError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> AnalysisAsyncCore( + AnalysisSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 3) + .Add("since.signature", request.SinceSignature) + .Add("since.revision", request.SinceRevision) + .Add("level", request.Level) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/docs/{0}/layers/{1}/signatures/analysis", + ValueConvert.ToPathParameterString(request.DocId), + ValueConvert.ToPathParameterString(request.LayerName) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CloudPDFApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> PrepareAsyncCore( + PrepareSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var multipartFormRequest_ = new MultipartFormRequest + { + Method = HttpMethod.Post, + Path = string.Format( + "v1/docs/{0}/layers/{1}/signatures/prepare", + ValueConvert.ToPathParameterString(request.DocId), + ValueConvert.ToPathParameterString(request.LayerName) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }; + multipartFormRequest_.AddFileParameterPart("file", request.File); + var response = await _client + .SendRequestAsync(multipartFormRequest_, cancellationToken) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CloudPDFApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 409: + throw new ConflictError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + /// + /// Describes the bytes the layer is over: the base version's signatures plus the layer's own edits as the last revision. Signed bytes (contents, digests, revision prefixes) are served per base version under /versions. + /// + /// + /// await client.Doc.Signatures.ListAsync( + /// new ListSignaturesRequest { DocId = "docId", LayerName = "layerName" } + /// ); + /// + public WithRawResponseTask ListAsync( + ListSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + ListAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// await client.Doc.Signatures.AbortAsync( + /// new AbortSignaturesRequest + /// { + /// DocId = "docId", + /// LayerName = "layerName", + /// SigningId = "signingId", + /// } + /// ); + /// + public WithRawResponseTask AbortAsync( + AbortSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + AbortAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// `cms` is the detached CMS over the prepared digest, base64. `expectedVersion` must be what prepare returned. Idempotent by signing id: the same CMS again answers `already-completed`. Every layer of the document then sits over the new version; refetch the manifest after a completion. + /// + /// + /// await client.Doc.Signatures.CompleteAsync( + /// new DocSignaturesCompleteRequest + /// { + /// DocId = "docId", + /// LayerName = "layerName", + /// SigningId = "signingId", + /// Cms = "cms", + /// ExpectedVersion = new DocSignaturesCompleteRequestExpectedVersion + /// { + /// BaseSha256 = "baseSha256", + /// EditsVersion = 1, + /// }, + /// } + /// ); + /// + public WithRawResponseTask CompleteAsync( + DocSignaturesCompleteRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + CompleteAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Exactly one of `since.signature=<index>` or `since.revision=<index>`; the layer's pending edits are the end. `level=fill|annotate|lta|none` evaluates exploratorily and never becomes a verdict. For history between two base revisions use the version analysis. + /// + /// + /// await client.Doc.Signatures.AnalysisAsync( + /// new AnalysisSignaturesRequest { DocId = "docId", LayerName = "layerName" } + /// ); + /// + public WithRawResponseTask AnalysisAsync( + AnalysisSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + AnalysisAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// The multipart envelope: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock, appearance) and an optional `resource:<key>` PDF part the body's `appearance.resource` names. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is aborted, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). + /// + /// + /// await client.Doc.Signatures.PrepareAsync( + /// new PrepareSignaturesRequest { DocId = "docId", LayerName = "layerName" } + /// ); + /// + public WithRawResponseTask PrepareAsync( + PrepareSignaturesRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + PrepareAsyncCore(request, options, cancellationToken) + ); + } +} diff --git a/src/CloudPDF/Doc/Signatures/Types/AnalysisSignaturesRequestLevel.cs b/src/CloudPDF/Doc/Signatures/Types/AnalysisSignaturesRequestLevel.cs new file mode 100644 index 0000000..7f2a5b2 --- /dev/null +++ b/src/CloudPDF/Doc/Signatures/Types/AnalysisSignaturesRequestLevel.cs @@ -0,0 +1,124 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[JsonConverter(typeof(AnalysisSignaturesRequestLevel.AnalysisSignaturesRequestLevelSerializer))] +[Serializable] +public readonly record struct AnalysisSignaturesRequestLevel : IStringEnum +{ + public static readonly AnalysisSignaturesRequestLevel None = new(Values.None); + + public static readonly AnalysisSignaturesRequestLevel Lta = new(Values.Lta); + + public static readonly AnalysisSignaturesRequestLevel Fill = new(Values.Fill); + + public static readonly AnalysisSignaturesRequestLevel Annotate = new(Values.Annotate); + + public AnalysisSignaturesRequestLevel(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static AnalysisSignaturesRequestLevel FromCustom(string value) + { + return new AnalysisSignaturesRequestLevel(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(AnalysisSignaturesRequestLevel value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(AnalysisSignaturesRequestLevel value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(AnalysisSignaturesRequestLevel value) => value.Value; + + public static explicit operator AnalysisSignaturesRequestLevel(string value) => new(value); + + internal class AnalysisSignaturesRequestLevelSerializer + : JsonConverter + { + public override AnalysisSignaturesRequestLevel Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new AnalysisSignaturesRequestLevel(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + AnalysisSignaturesRequestLevel value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override AnalysisSignaturesRequestLevel ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new AnalysisSignaturesRequestLevel(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + AnalysisSignaturesRequestLevel value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string None = "none"; + + public const string Lta = "lta"; + + public const string Fill = "fill"; + + public const string Annotate = "annotate"; + } +} diff --git a/src/CloudPDF/Doc/Signatures/Types/DocSignaturesCompleteRequestExpectedVersion.cs b/src/CloudPDF/Doc/Signatures/Types/DocSignaturesCompleteRequestExpectedVersion.cs new file mode 100644 index 0000000..0638311 --- /dev/null +++ b/src/CloudPDF/Doc/Signatures/Types/DocSignaturesCompleteRequestExpectedVersion.cs @@ -0,0 +1,32 @@ +using CloudPDF; +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record DocSignaturesCompleteRequestExpectedVersion : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("baseSha256")] + public required string BaseSha256 { get; set; } + + [JsonPropertyName("editsVersion")] + public required int EditsVersion { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Versions/IVersionsClient.cs b/src/CloudPDF/Doc/Versions/IVersionsClient.cs new file mode 100644 index 0000000..d766fa5 --- /dev/null +++ b/src/CloudPDF/Doc/Versions/IVersionsClient.cs @@ -0,0 +1,60 @@ +using CloudPDF; + +namespace CloudPDF.Doc; + +public partial interface IVersionsClient +{ + /// + /// Every completed signature publishes a new version. Never cached: the list grows. + /// + WithRawResponseTask ListAsync( + ListVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// Exactly one of `since.signature` / `since.revision`; `until=<revision>` defaults to the last. The same answer for every layer and every caller. + /// + WithRawResponseTask AnalysisAsync( + AnalysisVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask DownloadAsync( + DownloadVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask RevisionAsync( + RevisionVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + WithRawResponseTask SignaturesAsync( + SignaturesVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// `fieldKey` is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). + /// + WithRawResponseTask SignatureContentsAsync( + SignatureContentsVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); + + /// + /// What a CMS verifier compares its message digest to. + /// + WithRawResponseTask SignatureDigestAsync( + SignatureDigestVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ); +} diff --git a/src/CloudPDF/Doc/Versions/Requests/AnalysisVersionsRequest.cs b/src/CloudPDF/Doc/Versions/Requests/AnalysisVersionsRequest.cs new file mode 100644 index 0000000..f3f9ad9 --- /dev/null +++ b/src/CloudPDF/Doc/Versions/Requests/AnalysisVersionsRequest.cs @@ -0,0 +1,41 @@ +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record AnalysisVersionsRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + [JsonIgnore] + public required string Sha { get; set; } + + [JsonIgnore] + public int? SinceSignature { get; set; } + + [JsonIgnore] + public int? SinceRevision { get; set; } + + [JsonIgnore] + public AnalysisVersionsRequestLevel? Level { get; set; } + + [JsonIgnore] + public int? Until { get; set; } + + [JsonIgnore] + public int? Policy { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Versions/Requests/DownloadVersionsRequest.cs b/src/CloudPDF/Doc/Versions/Requests/DownloadVersionsRequest.cs new file mode 100644 index 0000000..87f8b5f --- /dev/null +++ b/src/CloudPDF/Doc/Versions/Requests/DownloadVersionsRequest.cs @@ -0,0 +1,26 @@ +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record DownloadVersionsRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + [JsonIgnore] + public required string Sha { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Versions/Requests/ListVersionsRequest.cs b/src/CloudPDF/Doc/Versions/Requests/ListVersionsRequest.cs new file mode 100644 index 0000000..fc17e2f --- /dev/null +++ b/src/CloudPDF/Doc/Versions/Requests/ListVersionsRequest.cs @@ -0,0 +1,23 @@ +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record ListVersionsRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Versions/Requests/RevisionVersionsRequest.cs b/src/CloudPDF/Doc/Versions/Requests/RevisionVersionsRequest.cs new file mode 100644 index 0000000..e08dfb6 --- /dev/null +++ b/src/CloudPDF/Doc/Versions/Requests/RevisionVersionsRequest.cs @@ -0,0 +1,29 @@ +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record RevisionVersionsRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + [JsonIgnore] + public required string Sha { get; set; } + + [JsonIgnore] + public required int Index { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Versions/Requests/SignatureContentsVersionsRequest.cs b/src/CloudPDF/Doc/Versions/Requests/SignatureContentsVersionsRequest.cs new file mode 100644 index 0000000..249cec8 --- /dev/null +++ b/src/CloudPDF/Doc/Versions/Requests/SignatureContentsVersionsRequest.cs @@ -0,0 +1,29 @@ +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record SignatureContentsVersionsRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + [JsonIgnore] + public required string Sha { get; set; } + + [JsonIgnore] + public required string FieldKey { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Versions/Requests/SignatureDigestVersionsRequest.cs b/src/CloudPDF/Doc/Versions/Requests/SignatureDigestVersionsRequest.cs new file mode 100644 index 0000000..aed6701 --- /dev/null +++ b/src/CloudPDF/Doc/Versions/Requests/SignatureDigestVersionsRequest.cs @@ -0,0 +1,32 @@ +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record SignatureDigestVersionsRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + [JsonIgnore] + public required string Sha { get; set; } + + [JsonIgnore] + public required string FieldKey { get; set; } + + [JsonIgnore] + public required SignatureDigestVersionsRequestAlgorithm Algorithm { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Versions/Requests/SignaturesVersionsRequest.cs b/src/CloudPDF/Doc/Versions/Requests/SignaturesVersionsRequest.cs new file mode 100644 index 0000000..117480f --- /dev/null +++ b/src/CloudPDF/Doc/Versions/Requests/SignaturesVersionsRequest.cs @@ -0,0 +1,26 @@ +using CloudPDF.Core; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[Serializable] +public record SignaturesVersionsRequest +{ + [JsonIgnore] + public required string DocId { get; set; } + + [JsonIgnore] + public required string Sha { get; set; } + + /// + /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + /// + [JsonIgnore] + public string? DocumentPassword { get; set; } + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Doc/Versions/Types/AnalysisVersionsRequestLevel.cs b/src/CloudPDF/Doc/Versions/Types/AnalysisVersionsRequestLevel.cs new file mode 100644 index 0000000..1481adb --- /dev/null +++ b/src/CloudPDF/Doc/Versions/Types/AnalysisVersionsRequestLevel.cs @@ -0,0 +1,124 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[JsonConverter(typeof(AnalysisVersionsRequestLevel.AnalysisVersionsRequestLevelSerializer))] +[Serializable] +public readonly record struct AnalysisVersionsRequestLevel : IStringEnum +{ + public static readonly AnalysisVersionsRequestLevel None = new(Values.None); + + public static readonly AnalysisVersionsRequestLevel Lta = new(Values.Lta); + + public static readonly AnalysisVersionsRequestLevel Fill = new(Values.Fill); + + public static readonly AnalysisVersionsRequestLevel Annotate = new(Values.Annotate); + + public AnalysisVersionsRequestLevel(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static AnalysisVersionsRequestLevel FromCustom(string value) + { + return new AnalysisVersionsRequestLevel(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(AnalysisVersionsRequestLevel value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(AnalysisVersionsRequestLevel value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(AnalysisVersionsRequestLevel value) => value.Value; + + public static explicit operator AnalysisVersionsRequestLevel(string value) => new(value); + + internal class AnalysisVersionsRequestLevelSerializer + : JsonConverter + { + public override AnalysisVersionsRequestLevel Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new AnalysisVersionsRequestLevel(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + AnalysisVersionsRequestLevel value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override AnalysisVersionsRequestLevel ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new AnalysisVersionsRequestLevel(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + AnalysisVersionsRequestLevel value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string None = "none"; + + public const string Lta = "lta"; + + public const string Fill = "fill"; + + public const string Annotate = "annotate"; + } +} diff --git a/src/CloudPDF/Doc/Versions/Types/SignatureDigestVersionsRequestAlgorithm.cs b/src/CloudPDF/Doc/Versions/Types/SignatureDigestVersionsRequestAlgorithm.cs new file mode 100644 index 0000000..b4b0b83 --- /dev/null +++ b/src/CloudPDF/Doc/Versions/Types/SignatureDigestVersionsRequestAlgorithm.cs @@ -0,0 +1,128 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF.Doc; + +[JsonConverter( + typeof(SignatureDigestVersionsRequestAlgorithm.SignatureDigestVersionsRequestAlgorithmSerializer) +)] +[Serializable] +public readonly record struct SignatureDigestVersionsRequestAlgorithm : IStringEnum +{ + public static readonly SignatureDigestVersionsRequestAlgorithm Sha1 = new(Values.Sha1); + + public static readonly SignatureDigestVersionsRequestAlgorithm Sha256 = new(Values.Sha256); + + public static readonly SignatureDigestVersionsRequestAlgorithm Sha384 = new(Values.Sha384); + + public static readonly SignatureDigestVersionsRequestAlgorithm Sha512 = new(Values.Sha512); + + public SignatureDigestVersionsRequestAlgorithm(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static SignatureDigestVersionsRequestAlgorithm FromCustom(string value) + { + return new SignatureDigestVersionsRequestAlgorithm(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(SignatureDigestVersionsRequestAlgorithm value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(SignatureDigestVersionsRequestAlgorithm value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(SignatureDigestVersionsRequestAlgorithm value) => + value.Value; + + public static explicit operator SignatureDigestVersionsRequestAlgorithm(string value) => + new(value); + + internal class SignatureDigestVersionsRequestAlgorithmSerializer + : JsonConverter + { + public override SignatureDigestVersionsRequestAlgorithm Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new SignatureDigestVersionsRequestAlgorithm(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + SignatureDigestVersionsRequestAlgorithm value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override SignatureDigestVersionsRequestAlgorithm ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new SignatureDigestVersionsRequestAlgorithm(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + SignatureDigestVersionsRequestAlgorithm value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Sha1 = "sha1"; + + public const string Sha256 = "sha256"; + + public const string Sha384 = "sha384"; + + public const string Sha512 = "sha512"; + } +} diff --git a/src/CloudPDF/Doc/Versions/VersionsClient.cs b/src/CloudPDF/Doc/Versions/VersionsClient.cs new file mode 100644 index 0000000..46bd51d --- /dev/null +++ b/src/CloudPDF/Doc/Versions/VersionsClient.cs @@ -0,0 +1,849 @@ +using CloudPDF; +using CloudPDF.Core; +using global::System.Text.Json; + +namespace CloudPDF.Doc; + +public partial class VersionsClient : IVersionsClient +{ + private readonly RawClient _client; + + internal VersionsClient(RawClient client) + { + _client = client; + } + + private async Task> ListAsyncCore( + ListVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/docs/{0}/versions", + ValueConvert.ToPathParameterString(request.DocId) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize(responseBody)!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CloudPDFApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> AnalysisAsyncCore( + AnalysisVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 5) + .Add("since.signature", request.SinceSignature) + .Add("since.revision", request.SinceRevision) + .Add("level", request.Level) + .Add("until", request.Until) + .Add("policy", request.Policy) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/docs/{0}/versions/analysis/{1}", + ValueConvert.ToPathParameterString(request.DocId), + ValueConvert.ToPathParameterString(request.Sha) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CloudPDFApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 400: + throw new BadRequestError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> DownloadAsyncCore( + DownloadVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/docs/{0}/versions/download/{1}", + ValueConvert.ToPathParameterString(request.DocId), + ValueConvert.ToPathParameterString(request.Sha) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var stream = await response.Raw.Content.ReadAsStreamAsync(); + return new WithRawResponse() + { + Data = stream, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> RevisionAsyncCore( + RevisionVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/docs/{0}/versions/revisions/{1}/{2}", + ValueConvert.ToPathParameterString(request.DocId), + ValueConvert.ToPathParameterString(request.Sha), + ValueConvert.ToPathParameterString(request.Index) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var stream = await response.Raw.Content.ReadAsStreamAsync(); + return new WithRawResponse() + { + Data = stream, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> SignaturesAsyncCore( + SignaturesVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/docs/{0}/versions/signatures/{1}", + ValueConvert.ToPathParameterString(request.DocId), + ValueConvert.ToPathParameterString(request.Sha) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + var responseData = JsonUtils.Deserialize( + responseBody + )!; + return new WithRawResponse() + { + Data = responseData, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + catch (JsonException e) + { + throw new CloudPDFApiException( + "Failed to deserialize response", + response.StatusCode, + responseBody, + e, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> SignatureContentsAsyncCore( + SignatureContentsVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/docs/{0}/versions/signatures/{1}/{2}/contents", + ValueConvert.ToPathParameterString(request.DocId), + ValueConvert.ToPathParameterString(request.Sha), + ValueConvert.ToPathParameterString(request.FieldKey) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var stream = await response.Raw.Content.ReadAsStreamAsync(); + return new WithRawResponse() + { + Data = stream, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + private async Task> SignatureDigestAsyncCore( + SignatureDigestVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0) + .MergeAdditional(options?.AdditionalQueryParameters) + .Build(); + var _headers = await new CloudPDF.Core.HeadersBuilder.Builder() + .Add("X-Document-Password", request.DocumentPassword) + .Add(_client.Options.Headers) + .Add(_client.Options.AdditionalHeaders) + .Add(options?.AdditionalHeaders) + .BuildAsync() + .ConfigureAwait(false); + var response = await _client + .SendRequestAsync( + new JsonRequest + { + Method = HttpMethod.Get, + Path = string.Format( + "v1/docs/{0}/versions/signatures/{1}/{2}/digest/{3}", + ValueConvert.ToPathParameterString(request.DocId), + ValueConvert.ToPathParameterString(request.Sha), + ValueConvert.ToPathParameterString(request.FieldKey), + ValueConvert.ToPathParameterString(request.Algorithm) + ), + QueryString = _queryString, + Headers = _headers, + Options = options, + }, + cancellationToken + ) + .ConfigureAwait(false); + if (response.StatusCode is >= 200 and < 400) + { + var stream = await response.Raw.Content.ReadAsStreamAsync(); + return new WithRawResponse() + { + Data = stream, + RawResponse = new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + }, + }; + } + { + var responseBody = await response + .Raw.Content.ReadAsStringAsync(cancellationToken) + .ConfigureAwait(false); + try + { + switch (response.StatusCode) + { + case 404: + throw new NotFoundError( + JsonUtils.Deserialize(responseBody), + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = + response.Raw.RequestMessage?.RequestUri + ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + catch (JsonException) + { + // unable to map error response, throwing generic error + } + throw new CloudPDFApiException( + $"Error with status code {response.StatusCode}", + response.StatusCode, + responseBody, + rawResponse: new CloudPDF.RawResponse() + { + StatusCode = response.Raw.StatusCode, + Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"), + Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw), + } + ); + } + } + + /// + /// Every completed signature publishes a new version. Never cached: the list grows. + /// + /// + /// await client.Doc.Versions.ListAsync(new ListVersionsRequest { DocId = "docId" }); + /// + public WithRawResponseTask ListAsync( + ListVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + ListAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// Exactly one of `since.signature` / `since.revision`; `until=<revision>` defaults to the last. The same answer for every layer and every caller. + /// + /// + /// await client.Doc.Versions.AnalysisAsync( + /// new AnalysisVersionsRequest { DocId = "docId", Sha = "sha" } + /// ); + /// + public WithRawResponseTask AnalysisAsync( + AnalysisVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + AnalysisAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// await client.Doc.Versions.DownloadAsync( + /// new DownloadVersionsRequest { DocId = "docId", Sha = "sha" } + /// ); + /// + public WithRawResponseTask DownloadAsync( + DownloadVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + DownloadAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// await client.Doc.Versions.RevisionAsync( + /// new RevisionVersionsRequest + /// { + /// DocId = "docId", + /// Sha = "sha", + /// Index = 1, + /// } + /// ); + /// + public WithRawResponseTask RevisionAsync( + RevisionVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + RevisionAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// await client.Doc.Versions.SignaturesAsync( + /// new SignaturesVersionsRequest { DocId = "docId", Sha = "sha" } + /// ); + /// + public WithRawResponseTask SignaturesAsync( + SignaturesVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + SignaturesAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// `fieldKey` is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). + /// + /// + /// await client.Doc.Versions.SignatureContentsAsync( + /// new SignatureContentsVersionsRequest + /// { + /// DocId = "docId", + /// Sha = "sha", + /// FieldKey = "fieldKey", + /// } + /// ); + /// + public WithRawResponseTask SignatureContentsAsync( + SignatureContentsVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + SignatureContentsAsyncCore(request, options, cancellationToken) + ); + } + + /// + /// What a CMS verifier compares its message digest to. + /// + /// + /// await client.Doc.Versions.SignatureDigestAsync( + /// new SignatureDigestVersionsRequest + /// { + /// DocId = "docId", + /// Sha = "sha", + /// FieldKey = "fieldKey", + /// Algorithm = SignatureDigestVersionsRequestAlgorithm.Sha1, + /// } + /// ); + /// + public WithRawResponseTask SignatureDigestAsync( + SignatureDigestVersionsRequest request, + RequestOptions? options = null, + CancellationToken cancellationToken = default + ) + { + return new WithRawResponseTask( + SignatureDigestAsyncCore(request, options, cancellationToken) + ); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsCreate200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocAnnotationsCreate200ResponseMetaCacheDelta.cs index 4fa7713..8b06477 100644 --- a/src/CloudPDF/Types/DocAnnotationsCreate200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocAnnotationsCreate200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocAnnotationsCreate200ResponseMetaCacheDelta : IJsonOnDeserialize [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocAnnotationsCreate400ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsCreate400ResponseCode.cs index c030954..4d92cbf 100644 --- a/src/CloudPDF/Types/DocAnnotationsCreate400ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsCreate400ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsCreate400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsCreate400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsCreate400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocAnnotationsCreate400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsCreate400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsCreate400ResponseCode StaleBase = new(Values.StaleBase); + public DocAnnotationsCreate400ResponseCode(string value) { Value = value; @@ -205,5 +227,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsCreate404ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsCreate404ResponseCode.cs index 92e3ea8..83858fc 100644 --- a/src/CloudPDF/Types/DocAnnotationsCreate404ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsCreate404ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsCreate404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsCreate404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsCreate404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocAnnotationsCreate404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsCreate404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsCreate404ResponseCode StaleBase = new(Values.StaleBase); + public DocAnnotationsCreate404ResponseCode(string value) { Value = value; @@ -205,5 +227,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsDelete200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocAnnotationsDelete200ResponseMetaCacheDelta.cs index 7c78c14..d5e6b18 100644 --- a/src/CloudPDF/Types/DocAnnotationsDelete200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocAnnotationsDelete200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocAnnotationsDelete200ResponseMetaCacheDelta : IJsonOnDeserialize [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocAnnotationsDelete404ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsDelete404ResponseCode.cs index 6bf46c4..22507d7 100644 --- a/src/CloudPDF/Types/DocAnnotationsDelete404ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsDelete404ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsDelete404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsDelete404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsDelete404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocAnnotationsDelete404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsDelete404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsDelete404ResponseCode StaleBase = new(Values.StaleBase); + public DocAnnotationsDelete404ResponseCode(string value) { Value = value; @@ -205,5 +227,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsExportAppearance400ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsExportAppearance400ResponseCode.cs index 66bea17..d41a1da 100644 --- a/src/CloudPDF/Types/DocAnnotationsExportAppearance400ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsExportAppearance400ResponseCode.cs @@ -84,6 +84,29 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsExportAppearance400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsExportAppearance400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsExportAppearance400ResponseCode SigningVersionMismatch = + new(Values.SigningVersionMismatch); + + public static readonly DocAnnotationsExportAppearance400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsExportAppearance400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsExportAppearance400ResponseCode StaleBase = new( + Values.StaleBase + ); + public DocAnnotationsExportAppearance400ResponseCode(string value) { Value = value; @@ -224,5 +247,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsExportAppearance404ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsExportAppearance404ResponseCode.cs index 92f6e81..6131cdc 100644 --- a/src/CloudPDF/Types/DocAnnotationsExportAppearance404ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsExportAppearance404ResponseCode.cs @@ -84,6 +84,29 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsExportAppearance404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsExportAppearance404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsExportAppearance404ResponseCode SigningVersionMismatch = + new(Values.SigningVersionMismatch); + + public static readonly DocAnnotationsExportAppearance404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsExportAppearance404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsExportAppearance404ResponseCode StaleBase = new( + Values.StaleBase + ); + public DocAnnotationsExportAppearance404ResponseCode(string value) { Value = value; @@ -224,5 +247,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsFlatten200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocAnnotationsFlatten200ResponseMetaCacheDelta.cs index 9f0b07b..3ab45a2 100644 --- a/src/CloudPDF/Types/DocAnnotationsFlatten200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocAnnotationsFlatten200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocAnnotationsFlatten200ResponseMetaCacheDelta : IJsonOnDeserializ [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocAnnotationsFlatten400ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsFlatten400ResponseCode.cs index 00cdef1..6134a47 100644 --- a/src/CloudPDF/Types/DocAnnotationsFlatten400ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsFlatten400ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsFlatten400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsFlatten400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsFlatten400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocAnnotationsFlatten400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsFlatten400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsFlatten400ResponseCode StaleBase = new(Values.StaleBase); + public DocAnnotationsFlatten400ResponseCode(string value) { Value = value; @@ -206,5 +228,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsFlatten404ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsFlatten404ResponseCode.cs index 8cf251a..d11dbb9 100644 --- a/src/CloudPDF/Types/DocAnnotationsFlatten404ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsFlatten404ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsFlatten404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsFlatten404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsFlatten404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocAnnotationsFlatten404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsFlatten404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsFlatten404ResponseCode StaleBase = new(Values.StaleBase); + public DocAnnotationsFlatten404ResponseCode(string value) { Value = value; @@ -206,5 +228,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeText.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeText.cs index 4785b84..4abc1fd 100644 --- a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeText.cs +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeText.cs @@ -75,7 +75,7 @@ public record DocAnnotationsList200ResponseAnnotationsItemFreeText : IJsonOnDese public required DocAnnotationsList200ResponseAnnotationsItemFreeTextIntent Intent { get; set; } [JsonPropertyName("fontFamily")] - public required DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily FontFamily { get; set; } + public required string FontFamily { get; set; } [JsonPropertyName("fontSize")] public required double FontSize { get; set; } @@ -83,6 +83,9 @@ public record DocAnnotationsList200ResponseAnnotationsItemFreeText : IJsonOnDese [JsonPropertyName("textAlign")] public required DocAnnotationsList200ResponseAnnotationsItemFreeTextTextAlign TextAlign { get; set; } + [JsonPropertyName("richText")] + public required DocAnnotationsList200ResponseAnnotationsItemFreeTextRichText RichText { get; set; } + [JsonPropertyName("color")] public required DocAnnotationsList200ResponseAnnotationsItemFreeTextColor Color { get; set; } diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily.cs deleted file mode 100644 index 1840718..0000000 --- a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily.cs +++ /dev/null @@ -1,191 +0,0 @@ -using CloudPDF.Core; -using global::System.Text.Json; -using global::System.Text.Json.Serialization; - -namespace CloudPDF; - -[JsonConverter( - typeof(DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily.DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamilySerializer) -)] -[Serializable] -public readonly record struct DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily - : IStringEnum -{ - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily Courier = - new(Values.Courier); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily CourierBold = - new(Values.CourierBold); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily CourierBoldOblique = - new(Values.CourierBoldOblique); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily CourierOblique = - new(Values.CourierOblique); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily Helvetica = - new(Values.Helvetica); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily HelveticaBold = - new(Values.HelveticaBold); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily HelveticaBoldOblique = - new(Values.HelveticaBoldOblique); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily HelveticaOblique = - new(Values.HelveticaOblique); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily TimesRoman = - new(Values.TimesRoman); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily TimesBold = - new(Values.TimesBold); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily TimesBoldItalic = - new(Values.TimesBoldItalic); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily TimesItalic = - new(Values.TimesItalic); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily Symbol = - new(Values.Symbol); - - public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily ZapfDingbats = - new(Values.ZapfDingbats); - - public DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily(string value) - { - Value = value; - } - - /// - /// The string value of the enum. - /// - public string Value { get; } - - /// - /// Create a string enum with the given value. - /// - public static DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily FromCustom( - string value - ) - { - return new DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily(value); - } - - public bool Equals(string? other) - { - return Value.Equals(other); - } - - /// - /// Returns the string value of the enum. - /// - public override string ToString() - { - return Value; - } - - public static bool operator ==( - DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily value1, - string value2 - ) => value1.Value.Equals(value2); - - public static bool operator !=( - DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily value1, - string value2 - ) => !value1.Value.Equals(value2); - - public static explicit operator string( - DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily value - ) => value.Value; - - public static explicit operator DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily( - string value - ) => new(value); - - internal class DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamilySerializer - : JsonConverter - { - public override DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily Read( - ref Utf8JsonReader reader, - Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON value could not be read as a string." - ); - return new DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily(stringValue); - } - - public override void Write( - Utf8JsonWriter writer, - DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily value, - JsonSerializerOptions options - ) - { - writer.WriteStringValue(value.Value); - } - - public override DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily ReadAsPropertyName( - ref Utf8JsonReader reader, - Type typeToConvert, - JsonSerializerOptions options - ) - { - var stringValue = - reader.GetString() - ?? throw new global::System.Exception( - "The JSON property name could not be read as a string." - ); - return new DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily(stringValue); - } - - public override void WriteAsPropertyName( - Utf8JsonWriter writer, - DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily value, - JsonSerializerOptions options - ) - { - writer.WritePropertyName(value.Value); - } - } - - /// - /// Constant strings for enum values - /// - [Serializable] - public static class Values - { - public const string Courier = "courier"; - - public const string CourierBold = "courier-bold"; - - public const string CourierBoldOblique = "courier-bold-oblique"; - - public const string CourierOblique = "courier-oblique"; - - public const string Helvetica = "helvetica"; - - public const string HelveticaBold = "helvetica-bold"; - - public const string HelveticaBoldOblique = "helvetica-bold-oblique"; - - public const string HelveticaOblique = "helvetica-oblique"; - - public const string TimesRoman = "times-roman"; - - public const string TimesBold = "times-bold"; - - public const string TimesBoldItalic = "times-bold-italic"; - - public const string TimesItalic = "times-italic"; - - public const string Symbol = "symbol"; - - public const string ZapfDingbats = "zapf-dingbats"; - } -} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichText.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichText.cs new file mode 100644 index 0000000..28295d7 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichText.cs @@ -0,0 +1,32 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsList200ResponseAnnotationsItemFreeTextRichText : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("body")] + public required DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBody Body { get; set; } + + [JsonPropertyName("paragraphs")] + public IEnumerable Paragraphs { get; set; } = + new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBody.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBody.cs new file mode 100644 index 0000000..7ed9bcd --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBody.cs @@ -0,0 +1,71 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBody : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("family")] + public required string Family { get; set; } + + [JsonPropertyName("weight")] + public required int Weight { get; set; } + + [JsonPropertyName("italic")] + public required bool Italic { get; set; } + + [JsonPropertyName("size")] + public required double Size { get; set; } + + [JsonPropertyName("color")] + public required string Color { get; set; } + + [JsonPropertyName("decoration")] + public IEnumerable Decoration { get; set; } = + new List(); + + [JsonPropertyName("script")] + public required DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript Script { get; set; } + + [JsonPropertyName("letterSpacing")] + public required double LetterSpacing { get; set; } + + [JsonPropertyName("horizontalScale")] + public required double HorizontalScale { get; set; } + + [JsonPropertyName("unknown")] + public string? Unknown { get; set; } + + [JsonPropertyName("align")] + public required DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign Align { get; set; } + + [JsonPropertyName("dir")] + public required DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir Dir { get; set; } + + [JsonPropertyName("lineHeight")] + public double? LineHeight { get; set; } + + [JsonPropertyName("margins")] + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyMargins? Margins { get; set; } + + [JsonPropertyName("textIndent")] + public double? TextIndent { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign.cs new file mode 100644 index 0000000..4cf9a93 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign.cs @@ -0,0 +1,145 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign.DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlignSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign + : IStringEnum +{ + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign Left = + new(Values.Left); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign Center = + new(Values.Center); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign Right = + new(Values.Right); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign Justify = + new(Values.Justify); + + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign FromCustom( + string value + ) + { + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign value + ) => value.Value; + + public static explicit operator DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign( + string value + ) => new(value); + + internal class DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlignSerializer + : JsonConverter + { + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Left = "left"; + + public const string Center = "center"; + + public const string Right = "right"; + + public const string Justify = "justify"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem.cs new file mode 100644 index 0000000..d9aba3e --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem.cs @@ -0,0 +1,144 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem.DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItemSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem + : IStringEnum +{ + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem Underline = + new(Values.Underline); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem LineThrough = + new(Values.LineThrough); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem Word = + new(Values.Word); + + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem FromCustom( + string value + ) + { + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem value + ) => value.Value; + + public static explicit operator DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem( + string value + ) => new(value); + + internal class DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItemSerializer + : JsonConverter + { + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDecorationItem value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Underline = "underline"; + + public const string LineThrough = "line-through"; + + public const string Word = "word"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir.cs new file mode 100644 index 0000000..b857bf3 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir.cs @@ -0,0 +1,135 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir.DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDirSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir + : IStringEnum +{ + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir Ltr = + new(Values.Ltr); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir Rtl = + new(Values.Rtl); + + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir FromCustom( + string value + ) + { + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir value + ) => value.Value; + + public static explicit operator DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir( + string value + ) => new(value); + + internal class DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDirSerializer + : JsonConverter + { + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyDir value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Ltr = "ltr"; + + public const string Rtl = "rtl"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyMargins.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyMargins.cs new file mode 100644 index 0000000..f809ed6 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyMargins.cs @@ -0,0 +1,38 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyMargins + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("top")] + public required double Top { get; set; } + + [JsonPropertyName("bottom")] + public required double Bottom { get; set; } + + [JsonPropertyName("left")] + public required double Left { get; set; } + + [JsonPropertyName("right")] + public required double Right { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript.cs new file mode 100644 index 0000000..2e4c005 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript.cs @@ -0,0 +1,140 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript.DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScriptSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript + : IStringEnum +{ + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript Normal = + new(Values.Normal); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript Sub = + new(Values.Sub); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript Super = + new(Values.Super); + + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript FromCustom( + string value + ) + { + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript value + ) => value.Value; + + public static explicit operator DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript( + string value + ) => new(value); + + internal class DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScriptSerializer + : JsonConverter + { + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Normal = "normal"; + + public const string Sub = "sub"; + + public const string Super = "super"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItem.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItem.cs new file mode 100644 index 0000000..e85a472 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItem.cs @@ -0,0 +1,48 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItem + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("align")] + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign? Align { get; set; } + + [JsonPropertyName("dir")] + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir? Dir { get; set; } + + [JsonPropertyName("lineHeight")] + public double? LineHeight { get; set; } + + [JsonPropertyName("margins")] + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemMargins? Margins { get; set; } + + [JsonPropertyName("textIndent")] + public double? TextIndent { get; set; } + + [JsonPropertyName("unknown")] + public string? Unknown { get; set; } + + [JsonPropertyName("runs")] + public IEnumerable Runs { get; set; } = + new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign.cs new file mode 100644 index 0000000..d9b7d47 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign.cs @@ -0,0 +1,149 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign.DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlignSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign + : IStringEnum +{ + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign Left = + new(Values.Left); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign Center = + new(Values.Center); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign Right = + new(Values.Right); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign Justify = + new(Values.Justify); + + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign FromCustom( + string value + ) + { + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign value + ) => value.Value; + + public static explicit operator DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign( + string value + ) => new(value); + + internal class DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlignSerializer + : JsonConverter + { + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Left = "left"; + + public const string Center = "center"; + + public const string Right = "right"; + + public const string Justify = "justify"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir.cs new file mode 100644 index 0000000..c366e14 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir.cs @@ -0,0 +1,139 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir.DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDirSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir + : IStringEnum +{ + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir Ltr = + new(Values.Ltr); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir Rtl = + new(Values.Rtl); + + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir FromCustom( + string value + ) + { + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir value + ) => value.Value; + + public static explicit operator DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir( + string value + ) => new(value); + + internal class DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDirSerializer + : JsonConverter + { + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemDir value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Ltr = "ltr"; + + public const string Rtl = "rtl"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemMargins.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemMargins.cs new file mode 100644 index 0000000..712eda9 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemMargins.cs @@ -0,0 +1,38 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemMargins + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("top")] + public required double Top { get; set; } + + [JsonPropertyName("bottom")] + public required double Bottom { get; set; } + + [JsonPropertyName("left")] + public required double Left { get; set; } + + [JsonPropertyName("right")] + public required double Right { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.cs new file mode 100644 index 0000000..0552848 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.cs @@ -0,0 +1,32 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItem + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("text")] + public required string Text { get; set; } + + [JsonPropertyName("style")] + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle? Style { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.cs new file mode 100644 index 0000000..644fb74 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.cs @@ -0,0 +1,56 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("family")] + public string? Family { get; set; } + + [JsonPropertyName("weight")] + public int? Weight { get; set; } + + [JsonPropertyName("italic")] + public bool? Italic { get; set; } + + [JsonPropertyName("size")] + public double? Size { get; set; } + + [JsonPropertyName("color")] + public string? Color { get; set; } + + [JsonPropertyName("decoration")] + public IEnumerable? Decoration { get; set; } + + [JsonPropertyName("script")] + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript? Script { get; set; } + + [JsonPropertyName("letterSpacing")] + public double? LetterSpacing { get; set; } + + [JsonPropertyName("horizontalScale")] + public double? HorizontalScale { get; set; } + + [JsonPropertyName("unknown")] + public string? Unknown { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.cs new file mode 100644 index 0000000..eb05023 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.cs @@ -0,0 +1,144 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItemSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem + : IStringEnum +{ + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem Underline = + new(Values.Underline); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem LineThrough = + new(Values.LineThrough); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem Word = + new(Values.Word); + + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem FromCustom( + string value + ) + { + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem value + ) => value.Value; + + public static explicit operator DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem( + string value + ) => new(value); + + internal class DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItemSerializer + : JsonConverter + { + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Underline = "underline"; + + public const string LineThrough = "line-through"; + + public const string Word = "word"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript.cs b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript.cs new file mode 100644 index 0000000..89a62cb --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript.cs @@ -0,0 +1,144 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript.DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScriptSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript + : IStringEnum +{ + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript Normal = + new(Values.Normal); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript Sub = + new(Values.Sub); + + public static readonly DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript Super = + new(Values.Super); + + public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript FromCustom( + string value + ) + { + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript value + ) => value.Value; + + public static explicit operator DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript( + string value + ) => new(value); + + internal class DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScriptSerializer + : JsonConverter + { + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Normal = "normal"; + + public const string Sub = "sub"; + + public const string Super = "super"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsList404ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsList404ResponseCode.cs index 9725db1..c60e5d8 100644 --- a/src/CloudPDF/Types/DocAnnotationsList404ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsList404ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsList404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsList404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsList404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocAnnotationsList404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsList404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsList404ResponseCode StaleBase = new(Values.StaleBase); + public DocAnnotationsList404ResponseCode(string value) { Value = value; @@ -204,5 +226,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText.cs index b7f6ab7..7026790 100644 --- a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText.cs +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText.cs @@ -75,7 +75,7 @@ public record DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText : public required DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextIntent Intent { get; set; } [JsonPropertyName("fontFamily")] - public required DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily FontFamily { get; set; } + public required string FontFamily { get; set; } [JsonPropertyName("fontSize")] public required double FontSize { get; set; } @@ -83,6 +83,9 @@ public record DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText : [JsonPropertyName("textAlign")] public required DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextTextAlign TextAlign { get; set; } + [JsonPropertyName("richText")] + public required DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichText RichText { get; set; } + [JsonPropertyName("color")] public required DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextColor Color { get; set; } diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichText.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichText.cs new file mode 100644 index 0000000..be1800e --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichText.cs @@ -0,0 +1,33 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichText + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("body")] + public required DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBody Body { get; set; } + + [JsonPropertyName("paragraphs")] + public IEnumerable Paragraphs { get; set; } = + new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBody.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBody.cs new file mode 100644 index 0000000..96c5620 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBody.cs @@ -0,0 +1,72 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBody + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("family")] + public required string Family { get; set; } + + [JsonPropertyName("weight")] + public required int Weight { get; set; } + + [JsonPropertyName("italic")] + public required bool Italic { get; set; } + + [JsonPropertyName("size")] + public required double Size { get; set; } + + [JsonPropertyName("color")] + public required string Color { get; set; } + + [JsonPropertyName("decoration")] + public IEnumerable Decoration { get; set; } = + new List(); + + [JsonPropertyName("script")] + public required DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript Script { get; set; } + + [JsonPropertyName("letterSpacing")] + public required double LetterSpacing { get; set; } + + [JsonPropertyName("horizontalScale")] + public required double HorizontalScale { get; set; } + + [JsonPropertyName("unknown")] + public string? Unknown { get; set; } + + [JsonPropertyName("align")] + public required DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign Align { get; set; } + + [JsonPropertyName("dir")] + public required DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir Dir { get; set; } + + [JsonPropertyName("lineHeight")] + public double? LineHeight { get; set; } + + [JsonPropertyName("margins")] + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyMargins? Margins { get; set; } + + [JsonPropertyName("textIndent")] + public double? TextIndent { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign.cs new file mode 100644 index 0000000..8f29e3f --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign.cs @@ -0,0 +1,149 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign.DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlignSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign + : IStringEnum +{ + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign Left = + new(Values.Left); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign Center = + new(Values.Center); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign Right = + new(Values.Right); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign Justify = + new(Values.Justify); + + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign FromCustom( + string value + ) + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign value + ) => value.Value; + + public static explicit operator DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign( + string value + ) => new(value); + + internal class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlignSerializer + : JsonConverter + { + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Left = "left"; + + public const string Center = "center"; + + public const string Right = "right"; + + public const string Justify = "justify"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem.cs new file mode 100644 index 0000000..4f2c177 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem.cs @@ -0,0 +1,144 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem.DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItemSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem + : IStringEnum +{ + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem Underline = + new(Values.Underline); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem LineThrough = + new(Values.LineThrough); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem Word = + new(Values.Word); + + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem FromCustom( + string value + ) + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem value + ) => value.Value; + + public static explicit operator DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem( + string value + ) => new(value); + + internal class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItemSerializer + : JsonConverter + { + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDecorationItem value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Underline = "underline"; + + public const string LineThrough = "line-through"; + + public const string Word = "word"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir.cs new file mode 100644 index 0000000..3ebecd8 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir.cs @@ -0,0 +1,139 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir.DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDirSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir + : IStringEnum +{ + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir Ltr = + new(Values.Ltr); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir Rtl = + new(Values.Rtl); + + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir FromCustom( + string value + ) + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir value + ) => value.Value; + + public static explicit operator DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir( + string value + ) => new(value); + + internal class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDirSerializer + : JsonConverter + { + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyDir value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Ltr = "ltr"; + + public const string Rtl = "rtl"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyMargins.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyMargins.cs new file mode 100644 index 0000000..3471ab3 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyMargins.cs @@ -0,0 +1,38 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyMargins + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("top")] + public required double Top { get; set; } + + [JsonPropertyName("bottom")] + public required double Bottom { get; set; } + + [JsonPropertyName("left")] + public required double Left { get; set; } + + [JsonPropertyName("right")] + public required double Right { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript.cs new file mode 100644 index 0000000..e682dad --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript.cs @@ -0,0 +1,144 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript.DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScriptSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript + : IStringEnum +{ + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript Normal = + new(Values.Normal); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript Sub = + new(Values.Sub); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript Super = + new(Values.Super); + + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript FromCustom( + string value + ) + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript value + ) => value.Value; + + public static explicit operator DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript( + string value + ) => new(value); + + internal class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScriptSerializer + : JsonConverter + { + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Normal = "normal"; + + public const string Sub = "sub"; + + public const string Super = "super"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItem.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItem.cs new file mode 100644 index 0000000..6cfa77b --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItem.cs @@ -0,0 +1,48 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItem + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("align")] + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign? Align { get; set; } + + [JsonPropertyName("dir")] + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir? Dir { get; set; } + + [JsonPropertyName("lineHeight")] + public double? LineHeight { get; set; } + + [JsonPropertyName("margins")] + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemMargins? Margins { get; set; } + + [JsonPropertyName("textIndent")] + public double? TextIndent { get; set; } + + [JsonPropertyName("unknown")] + public string? Unknown { get; set; } + + [JsonPropertyName("runs")] + public IEnumerable Runs { get; set; } = + new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign.cs similarity index 52% rename from src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily.cs rename to src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign.cs index 9e34de7..52db889 100644 --- a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily.cs +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign.cs @@ -5,55 +5,27 @@ namespace CloudPDF; [JsonConverter( - typeof(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily.DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamilySerializer) + typeof(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign.DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlignSerializer) )] [Serializable] -public readonly record struct DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily +public readonly record struct DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign : IStringEnum { - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily Courier = - new(Values.Courier); + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign Left = + new(Values.Left); - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily CourierBold = - new(Values.CourierBold); + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign Center = + new(Values.Center); - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily CourierBoldOblique = - new(Values.CourierBoldOblique); + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign Right = + new(Values.Right); - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily CourierOblique = - new(Values.CourierOblique); + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign Justify = + new(Values.Justify); - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily Helvetica = - new(Values.Helvetica); - - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily HelveticaBold = - new(Values.HelveticaBold); - - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily HelveticaBoldOblique = - new(Values.HelveticaBoldOblique); - - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily HelveticaOblique = - new(Values.HelveticaOblique); - - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily TimesRoman = - new(Values.TimesRoman); - - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily TimesBold = - new(Values.TimesBold); - - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily TimesBoldItalic = - new(Values.TimesBoldItalic); - - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily TimesItalic = - new(Values.TimesItalic); - - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily Symbol = - new(Values.Symbol); - - public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily ZapfDingbats = - new(Values.ZapfDingbats); - - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily(string value) + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign( + string value + ) { Value = value; } @@ -66,11 +38,11 @@ public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamil /// /// Create a string enum with the given value. /// - public static DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily FromCustom( + public static DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign FromCustom( string value ) { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily( + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign( value ); } @@ -89,27 +61,27 @@ public override string ToString() } public static bool operator ==( - DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily value1, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign value1, string value2 ) => value1.Value.Equals(value2); public static bool operator !=( - DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily value1, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign value1, string value2 ) => !value1.Value.Equals(value2); public static explicit operator string( - DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily value + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign value ) => value.Value; - public static explicit operator DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily( + public static explicit operator DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign( string value ) => new(value); - internal class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamilySerializer - : JsonConverter + internal class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlignSerializer + : JsonConverter { - public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily Read( + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign Read( ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options @@ -120,21 +92,21 @@ JsonSerializerOptions options ?? throw new global::System.Exception( "The JSON value could not be read as a string." ); - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily( + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign( stringValue ); } public override void Write( Utf8JsonWriter writer, - DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily value, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign value, JsonSerializerOptions options ) { writer.WriteStringValue(value.Value); } - public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily ReadAsPropertyName( + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign ReadAsPropertyName( ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options @@ -145,14 +117,14 @@ JsonSerializerOptions options ?? throw new global::System.Exception( "The JSON property name could not be read as a string." ); - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily( + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign( stringValue ); } public override void WriteAsPropertyName( Utf8JsonWriter writer, - DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontFamily value, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign value, JsonSerializerOptions options ) { @@ -166,32 +138,12 @@ JsonSerializerOptions options [Serializable] public static class Values { - public const string Courier = "courier"; - - public const string CourierBold = "courier-bold"; - - public const string CourierBoldOblique = "courier-bold-oblique"; - - public const string CourierOblique = "courier-oblique"; - - public const string Helvetica = "helvetica"; - - public const string HelveticaBold = "helvetica-bold"; - - public const string HelveticaBoldOblique = "helvetica-bold-oblique"; - - public const string HelveticaOblique = "helvetica-oblique"; - - public const string TimesRoman = "times-roman"; - - public const string TimesBold = "times-bold"; - - public const string TimesBoldItalic = "times-bold-italic"; + public const string Left = "left"; - public const string TimesItalic = "times-italic"; + public const string Center = "center"; - public const string Symbol = "symbol"; + public const string Right = "right"; - public const string ZapfDingbats = "zapf-dingbats"; + public const string Justify = "justify"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir.cs new file mode 100644 index 0000000..06a1e9a --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir.cs @@ -0,0 +1,139 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir.DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDirSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir + : IStringEnum +{ + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir Ltr = + new(Values.Ltr); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir Rtl = + new(Values.Rtl); + + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir FromCustom( + string value + ) + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir value + ) => value.Value; + + public static explicit operator DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir( + string value + ) => new(value); + + internal class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDirSerializer + : JsonConverter + { + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemDir value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Ltr = "ltr"; + + public const string Rtl = "rtl"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemMargins.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemMargins.cs new file mode 100644 index 0000000..2644b2b --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemMargins.cs @@ -0,0 +1,38 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemMargins + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("top")] + public required double Top { get; set; } + + [JsonPropertyName("bottom")] + public required double Bottom { get; set; } + + [JsonPropertyName("left")] + public required double Left { get; set; } + + [JsonPropertyName("right")] + public required double Right { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.cs new file mode 100644 index 0000000..1010df3 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.cs @@ -0,0 +1,32 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItem + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("text")] + public required string Text { get; set; } + + [JsonPropertyName("style")] + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle? Style { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.cs new file mode 100644 index 0000000..e1b28a8 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.cs @@ -0,0 +1,56 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("family")] + public string? Family { get; set; } + + [JsonPropertyName("weight")] + public int? Weight { get; set; } + + [JsonPropertyName("italic")] + public bool? Italic { get; set; } + + [JsonPropertyName("size")] + public double? Size { get; set; } + + [JsonPropertyName("color")] + public string? Color { get; set; } + + [JsonPropertyName("decoration")] + public IEnumerable? Decoration { get; set; } + + [JsonPropertyName("script")] + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript? Script { get; set; } + + [JsonPropertyName("letterSpacing")] + public double? LetterSpacing { get; set; } + + [JsonPropertyName("horizontalScale")] + public double? HorizontalScale { get; set; } + + [JsonPropertyName("unknown")] + public string? Unknown { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.cs new file mode 100644 index 0000000..77bee07 --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.cs @@ -0,0 +1,144 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItemSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem + : IStringEnum +{ + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem Underline = + new(Values.Underline); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem LineThrough = + new(Values.LineThrough); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem Word = + new(Values.Word); + + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem FromCustom( + string value + ) + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem value + ) => value.Value; + + public static explicit operator DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem( + string value + ) => new(value); + + internal class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItemSerializer + : JsonConverter + { + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Underline = "underline"; + + public const string LineThrough = "line-through"; + + public const string Word = "word"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript.cs b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript.cs new file mode 100644 index 0000000..f92a38c --- /dev/null +++ b/src/CloudPDF/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript.cs @@ -0,0 +1,144 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript.DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScriptSerializer) +)] +[Serializable] +public readonly record struct DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript + : IStringEnum +{ + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript Normal = + new(Values.Normal); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript Sub = + new(Values.Sub); + + public static readonly DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript Super = + new(Values.Super); + + public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript( + string value + ) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript FromCustom( + string value + ) + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript( + value + ); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript value + ) => value.Value; + + public static explicit operator DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript( + string value + ) => new(value); + + internal class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScriptSerializer + : JsonConverter + { + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleScript value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Normal = "normal"; + + public const string Sub = "sub"; + + public const string Super = "super"; + } +} diff --git a/src/CloudPDF/Types/DocAnnotationsListAll404ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsListAll404ResponseCode.cs index 097b79b..981a5a4 100644 --- a/src/CloudPDF/Types/DocAnnotationsListAll404ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsListAll404ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsListAll404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsListAll404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsListAll404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocAnnotationsListAll404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsListAll404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsListAll404ResponseCode StaleBase = new(Values.StaleBase); + public DocAnnotationsListAll404ResponseCode(string value) { Value = value; @@ -206,5 +228,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsListAll409ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsListAll409ResponseCode.cs index 9f0f9ca..5d8d60d 100644 --- a/src/CloudPDF/Types/DocAnnotationsListAll409ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsListAll409ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsListAll409ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsListAll409ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsListAll409ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocAnnotationsListAll409ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsListAll409ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsListAll409ResponseCode StaleBase = new(Values.StaleBase); + public DocAnnotationsListAll409ResponseCode(string value) { Value = value; @@ -206,5 +228,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsUpdate200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocAnnotationsUpdate200ResponseMetaCacheDelta.cs index 414db83..8c7470c 100644 --- a/src/CloudPDF/Types/DocAnnotationsUpdate200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocAnnotationsUpdate200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocAnnotationsUpdate200ResponseMetaCacheDelta : IJsonOnDeserialize [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocAnnotationsUpdate400ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsUpdate400ResponseCode.cs index 93ee881..0d99bb8 100644 --- a/src/CloudPDF/Types/DocAnnotationsUpdate400ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsUpdate400ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsUpdate400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsUpdate400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsUpdate400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocAnnotationsUpdate400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsUpdate400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsUpdate400ResponseCode StaleBase = new(Values.StaleBase); + public DocAnnotationsUpdate400ResponseCode(string value) { Value = value; @@ -205,5 +227,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocAnnotationsUpdate404ResponseCode.cs b/src/CloudPDF/Types/DocAnnotationsUpdate404ResponseCode.cs index cd7feef..9a9bd34 100644 --- a/src/CloudPDF/Types/DocAnnotationsUpdate404ResponseCode.cs +++ b/src/CloudPDF/Types/DocAnnotationsUpdate404ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocAnnotationsUpdate404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocAnnotationsUpdate404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocAnnotationsUpdate404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocAnnotationsUpdate404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocAnnotationsUpdate404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocAnnotationsUpdate404ResponseCode StaleBase = new(Values.StaleBase); + public DocAnnotationsUpdate404ResponseCode(string value) { Value = value; @@ -205,5 +227,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocDownloadResponseCode.cs b/src/CloudPDF/Types/DocDownloadResponseCode.cs index 3b99489..f0c5ed2 100644 --- a/src/CloudPDF/Types/DocDownloadResponseCode.cs +++ b/src/CloudPDF/Types/DocDownloadResponseCode.cs @@ -58,6 +58,22 @@ namespace CloudPDF; public static readonly DocDownloadResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocDownloadResponseCode SigningPending = new(Values.SigningPending); + + public static readonly DocDownloadResponseCode SigningExpired = new(Values.SigningExpired); + + public static readonly DocDownloadResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocDownloadResponseCode SignatureRefused = new(Values.SignatureRefused); + + public static readonly DocDownloadResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocDownloadResponseCode StaleBase = new(Values.StaleBase); + public DocDownloadResponseCode(string value) { Value = value; @@ -191,5 +207,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocFormsExportDataResponseCode.cs b/src/CloudPDF/Types/DocFormsExportDataResponseCode.cs index ad558d4..8e5b6c2 100644 --- a/src/CloudPDF/Types/DocFormsExportDataResponseCode.cs +++ b/src/CloudPDF/Types/DocFormsExportDataResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocFormsExportDataResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocFormsExportDataResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocFormsExportDataResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocFormsExportDataResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocFormsExportDataResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocFormsExportDataResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocFormsExportDataResponseCode StaleBase = new(Values.StaleBase); + public DocFormsExportDataResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocFormsGet404ResponseCode.cs b/src/CloudPDF/Types/DocFormsGet404ResponseCode.cs index 77e384f..6597cf5 100644 --- a/src/CloudPDF/Types/DocFormsGet404ResponseCode.cs +++ b/src/CloudPDF/Types/DocFormsGet404ResponseCode.cs @@ -60,6 +60,24 @@ namespace CloudPDF; public static readonly DocFormsGet404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocFormsGet404ResponseCode SigningPending = new(Values.SigningPending); + + public static readonly DocFormsGet404ResponseCode SigningExpired = new(Values.SigningExpired); + + public static readonly DocFormsGet404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocFormsGet404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocFormsGet404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocFormsGet404ResponseCode StaleBase = new(Values.StaleBase); + public DocFormsGet404ResponseCode(string value) { Value = value; @@ -193,5 +211,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocFormsImportData200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocFormsImportData200ResponseMetaCacheDelta.cs index 2f3885e..ad3b1eb 100644 --- a/src/CloudPDF/Types/DocFormsImportData200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocFormsImportData200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocFormsImportData200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocFormsImportData400ResponseCode.cs b/src/CloudPDF/Types/DocFormsImportData400ResponseCode.cs index addfe7c..8e52b9e 100644 --- a/src/CloudPDF/Types/DocFormsImportData400ResponseCode.cs +++ b/src/CloudPDF/Types/DocFormsImportData400ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocFormsImportData400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocFormsImportData400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocFormsImportData400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocFormsImportData400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocFormsImportData400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocFormsImportData400ResponseCode StaleBase = new(Values.StaleBase); + public DocFormsImportData400ResponseCode(string value) { Value = value; @@ -204,5 +226,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocFormsImportData404ResponseCode.cs b/src/CloudPDF/Types/DocFormsImportData404ResponseCode.cs index 105ac74..2d4e69f 100644 --- a/src/CloudPDF/Types/DocFormsImportData404ResponseCode.cs +++ b/src/CloudPDF/Types/DocFormsImportData404ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocFormsImportData404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocFormsImportData404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocFormsImportData404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocFormsImportData404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocFormsImportData404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocFormsImportData404ResponseCode StaleBase = new(Values.StaleBase); + public DocFormsImportData404ResponseCode(string value) { Value = value; @@ -204,5 +226,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocFormsReset200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocFormsReset200ResponseMetaCacheDelta.cs index 65fa648..2465a1a 100644 --- a/src/CloudPDF/Types/DocFormsReset200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocFormsReset200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocFormsReset200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocFormsReset404ResponseCode.cs b/src/CloudPDF/Types/DocFormsReset404ResponseCode.cs index 471fa36..caf3ae4 100644 --- a/src/CloudPDF/Types/DocFormsReset404ResponseCode.cs +++ b/src/CloudPDF/Types/DocFormsReset404ResponseCode.cs @@ -62,6 +62,24 @@ namespace CloudPDF; public static readonly DocFormsReset404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocFormsReset404ResponseCode SigningPending = new(Values.SigningPending); + + public static readonly DocFormsReset404ResponseCode SigningExpired = new(Values.SigningExpired); + + public static readonly DocFormsReset404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocFormsReset404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocFormsReset404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocFormsReset404ResponseCode StaleBase = new(Values.StaleBase); + public DocFormsReset404ResponseCode(string value) { Value = value; @@ -196,5 +214,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocFormsSetValue200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocFormsSetValue200ResponseMetaCacheDelta.cs index 90a1280..effec47 100644 --- a/src/CloudPDF/Types/DocFormsSetValue200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocFormsSetValue200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocFormsSetValue200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocFormsSetValue400ResponseCode.cs b/src/CloudPDF/Types/DocFormsSetValue400ResponseCode.cs index c519c64..1cc62b1 100644 --- a/src/CloudPDF/Types/DocFormsSetValue400ResponseCode.cs +++ b/src/CloudPDF/Types/DocFormsSetValue400ResponseCode.cs @@ -66,6 +66,28 @@ namespace CloudPDF; public static readonly DocFormsSetValue400ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocFormsSetValue400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocFormsSetValue400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocFormsSetValue400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocFormsSetValue400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocFormsSetValue400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocFormsSetValue400ResponseCode StaleBase = new(Values.StaleBase); + public DocFormsSetValue400ResponseCode(string value) { Value = value; @@ -200,5 +222,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocFormsSetValue404ResponseCode.cs b/src/CloudPDF/Types/DocFormsSetValue404ResponseCode.cs index c7837c2..1c1a145 100644 --- a/src/CloudPDF/Types/DocFormsSetValue404ResponseCode.cs +++ b/src/CloudPDF/Types/DocFormsSetValue404ResponseCode.cs @@ -66,6 +66,28 @@ namespace CloudPDF; public static readonly DocFormsSetValue404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocFormsSetValue404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocFormsSetValue404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocFormsSetValue404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocFormsSetValue404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocFormsSetValue404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocFormsSetValue404ResponseCode StaleBase = new(Values.StaleBase); + public DocFormsSetValue404ResponseCode(string value) { Value = value; @@ -200,5 +222,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocHead404ResponseCode.cs b/src/CloudPDF/Types/DocHead404ResponseCode.cs index a55c139..f80dd03 100644 --- a/src/CloudPDF/Types/DocHead404ResponseCode.cs +++ b/src/CloudPDF/Types/DocHead404ResponseCode.cs @@ -58,6 +58,20 @@ namespace CloudPDF; public static readonly DocHead404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocHead404ResponseCode SigningPending = new(Values.SigningPending); + + public static readonly DocHead404ResponseCode SigningExpired = new(Values.SigningExpired); + + public static readonly DocHead404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocHead404ResponseCode SignatureRefused = new(Values.SignatureRefused); + + public static readonly DocHead404ResponseCode ProtectedDocument = new(Values.ProtectedDocument); + + public static readonly DocHead404ResponseCode StaleBase = new(Values.StaleBase); + public DocHead404ResponseCode(string value) { Value = value; @@ -191,5 +205,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocManifest200Response.cs b/src/CloudPDF/Types/DocManifest200Response.cs index ef41825..0e3093b 100644 --- a/src/CloudPDF/Types/DocManifest200Response.cs +++ b/src/CloudPDF/Types/DocManifest200Response.cs @@ -35,6 +35,15 @@ public record DocManifest200Response : IJsonOnDeserialized [JsonPropertyName("baseSha")] public required string BaseSha { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + + [JsonPropertyName("baseByteLength")] + public int? BaseByteLength { get; set; } + [JsonPropertyName("scopes")] public DocManifest200ResponseScopes? Scopes { get; set; } diff --git a/src/CloudPDF/Types/DocManifest404ResponseCode.cs b/src/CloudPDF/Types/DocManifest404ResponseCode.cs index 6c3b98b..af54bce 100644 --- a/src/CloudPDF/Types/DocManifest404ResponseCode.cs +++ b/src/CloudPDF/Types/DocManifest404ResponseCode.cs @@ -60,6 +60,24 @@ namespace CloudPDF; public static readonly DocManifest404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocManifest404ResponseCode SigningPending = new(Values.SigningPending); + + public static readonly DocManifest404ResponseCode SigningExpired = new(Values.SigningExpired); + + public static readonly DocManifest404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocManifest404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocManifest404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocManifest404ResponseCode StaleBase = new(Values.StaleBase); + public DocManifest404ResponseCode(string value) { Value = value; @@ -193,5 +211,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocMetadataGet404ResponseCode.cs b/src/CloudPDF/Types/DocMetadataGet404ResponseCode.cs index a68b3fa..c072013 100644 --- a/src/CloudPDF/Types/DocMetadataGet404ResponseCode.cs +++ b/src/CloudPDF/Types/DocMetadataGet404ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocMetadataGet404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocMetadataGet404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocMetadataGet404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocMetadataGet404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocMetadataGet404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocMetadataGet404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocMetadataGet404ResponseCode StaleBase = new(Values.StaleBase); + public DocMetadataGet404ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesDelete200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocPagesDelete200ResponseMetaCacheDelta.cs index 30e3b1c..d9c681a 100644 --- a/src/CloudPDF/Types/DocPagesDelete200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocPagesDelete200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocPagesDelete200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocPagesDelete400ResponseCode.cs b/src/CloudPDF/Types/DocPagesDelete400ResponseCode.cs index 1d35117..2b62f5c 100644 --- a/src/CloudPDF/Types/DocPagesDelete400ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesDelete400ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesDelete400ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesDelete400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesDelete400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesDelete400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesDelete400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesDelete400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesDelete400ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesDelete400ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesDelete404ResponseCode.cs b/src/CloudPDF/Types/DocPagesDelete404ResponseCode.cs index a1edac5..99f3f77 100644 --- a/src/CloudPDF/Types/DocPagesDelete404ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesDelete404ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesDelete404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesDelete404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesDelete404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesDelete404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesDelete404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesDelete404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesDelete404ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesDelete404ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesExtract400ResponseCode.cs b/src/CloudPDF/Types/DocPagesExtract400ResponseCode.cs index e2dcabf..59da6d3 100644 --- a/src/CloudPDF/Types/DocPagesExtract400ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesExtract400ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesExtract400ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesExtract400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesExtract400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesExtract400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesExtract400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesExtract400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesExtract400ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesExtract400ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesExtract404ResponseCode.cs b/src/CloudPDF/Types/DocPagesExtract404ResponseCode.cs index 2d92d4f..5056d04 100644 --- a/src/CloudPDF/Types/DocPagesExtract404ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesExtract404ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesExtract404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesExtract404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesExtract404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesExtract404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesExtract404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesExtract404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesExtract404ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesExtract404ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesFlatten200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocPagesFlatten200ResponseMetaCacheDelta.cs index b61e598..a3c2945 100644 --- a/src/CloudPDF/Types/DocPagesFlatten200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocPagesFlatten200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocPagesFlatten200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocPagesFlatten400ResponseCode.cs b/src/CloudPDF/Types/DocPagesFlatten400ResponseCode.cs index e6b035a..24dba35 100644 --- a/src/CloudPDF/Types/DocPagesFlatten400ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesFlatten400ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesFlatten400ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesFlatten400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesFlatten400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesFlatten400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesFlatten400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesFlatten400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesFlatten400ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesFlatten400ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesFlatten404ResponseCode.cs b/src/CloudPDF/Types/DocPagesFlatten404ResponseCode.cs index a4de8ec..3bf0c48 100644 --- a/src/CloudPDF/Types/DocPagesFlatten404ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesFlatten404ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesFlatten404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesFlatten404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesFlatten404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesFlatten404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesFlatten404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesFlatten404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesFlatten404ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesFlatten404ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesInsert200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocPagesInsert200ResponseMetaCacheDelta.cs index 3267818..33a1204 100644 --- a/src/CloudPDF/Types/DocPagesInsert200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocPagesInsert200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocPagesInsert200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocPagesInsert400ResponseCode.cs b/src/CloudPDF/Types/DocPagesInsert400ResponseCode.cs index f23800d..eaf510e 100644 --- a/src/CloudPDF/Types/DocPagesInsert400ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesInsert400ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesInsert400ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesInsert400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesInsert400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesInsert400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesInsert400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesInsert400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesInsert400ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesInsert400ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesInsert404ResponseCode.cs b/src/CloudPDF/Types/DocPagesInsert404ResponseCode.cs index 01ba2c6..c28affe 100644 --- a/src/CloudPDF/Types/DocPagesInsert404ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesInsert404ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesInsert404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesInsert404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesInsert404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesInsert404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesInsert404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesInsert404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesInsert404ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesInsert404ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesInsertBlank200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocPagesInsertBlank200ResponseMetaCacheDelta.cs index 69d80d3..5f3b1b7 100644 --- a/src/CloudPDF/Types/DocPagesInsertBlank200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocPagesInsertBlank200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocPagesInsertBlank200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocPagesInsertBlank400ResponseCode.cs b/src/CloudPDF/Types/DocPagesInsertBlank400ResponseCode.cs index 731fee8..3758173 100644 --- a/src/CloudPDF/Types/DocPagesInsertBlank400ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesInsertBlank400ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocPagesInsertBlank400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesInsertBlank400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesInsertBlank400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesInsertBlank400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesInsertBlank400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesInsertBlank400ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesInsertBlank400ResponseCode(string value) { Value = value; @@ -204,5 +226,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesInsertBlank404ResponseCode.cs b/src/CloudPDF/Types/DocPagesInsertBlank404ResponseCode.cs index ac40dc5..b30543f 100644 --- a/src/CloudPDF/Types/DocPagesInsertBlank404ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesInsertBlank404ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocPagesInsertBlank404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesInsertBlank404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesInsertBlank404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesInsertBlank404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesInsertBlank404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesInsertBlank404ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesInsertBlank404ResponseCode(string value) { Value = value; @@ -204,5 +226,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesMove200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocPagesMove200ResponseMetaCacheDelta.cs index 9322153..5f74572 100644 --- a/src/CloudPDF/Types/DocPagesMove200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocPagesMove200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocPagesMove200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocPagesMove400ResponseCode.cs b/src/CloudPDF/Types/DocPagesMove400ResponseCode.cs index 09a964f..115487d 100644 --- a/src/CloudPDF/Types/DocPagesMove400ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesMove400ResponseCode.cs @@ -62,6 +62,24 @@ namespace CloudPDF; public static readonly DocPagesMove400ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesMove400ResponseCode SigningPending = new(Values.SigningPending); + + public static readonly DocPagesMove400ResponseCode SigningExpired = new(Values.SigningExpired); + + public static readonly DocPagesMove400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesMove400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesMove400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesMove400ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesMove400ResponseCode(string value) { Value = value; @@ -196,5 +214,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesMove404ResponseCode.cs b/src/CloudPDF/Types/DocPagesMove404ResponseCode.cs index 64905a5..e69d682 100644 --- a/src/CloudPDF/Types/DocPagesMove404ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesMove404ResponseCode.cs @@ -62,6 +62,24 @@ namespace CloudPDF; public static readonly DocPagesMove404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesMove404ResponseCode SigningPending = new(Values.SigningPending); + + public static readonly DocPagesMove404ResponseCode SigningExpired = new(Values.SigningExpired); + + public static readonly DocPagesMove404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesMove404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesMove404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesMove404ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesMove404ResponseCode(string value) { Value = value; @@ -196,5 +214,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesRemoveName200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocPagesRemoveName200ResponseMetaCacheDelta.cs index cdb80b6..64d663d 100644 --- a/src/CloudPDF/Types/DocPagesRemoveName200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocPagesRemoveName200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocPagesRemoveName200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocPagesRemoveName400ResponseCode.cs b/src/CloudPDF/Types/DocPagesRemoveName400ResponseCode.cs index c72fcdf..fdabed1 100644 --- a/src/CloudPDF/Types/DocPagesRemoveName400ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesRemoveName400ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocPagesRemoveName400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesRemoveName400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesRemoveName400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesRemoveName400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesRemoveName400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesRemoveName400ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesRemoveName400ResponseCode(string value) { Value = value; @@ -204,5 +226,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesRemoveName404ResponseCode.cs b/src/CloudPDF/Types/DocPagesRemoveName404ResponseCode.cs index bb00e75..55e8a6f 100644 --- a/src/CloudPDF/Types/DocPagesRemoveName404ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesRemoveName404ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocPagesRemoveName404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesRemoveName404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesRemoveName404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesRemoveName404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesRemoveName404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesRemoveName404ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesRemoveName404ResponseCode(string value) { Value = value; @@ -204,5 +226,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesRotate200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocPagesRotate200ResponseMetaCacheDelta.cs index 265feaa..dd76956 100644 --- a/src/CloudPDF/Types/DocPagesRotate200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocPagesRotate200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocPagesRotate200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocPagesRotate400ResponseCode.cs b/src/CloudPDF/Types/DocPagesRotate400ResponseCode.cs index 4ec60e7..1d65609 100644 --- a/src/CloudPDF/Types/DocPagesRotate400ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesRotate400ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesRotate400ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesRotate400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesRotate400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesRotate400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesRotate400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesRotate400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesRotate400ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesRotate400ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesRotate404ResponseCode.cs b/src/CloudPDF/Types/DocPagesRotate404ResponseCode.cs index 6992cc2..40a6acd 100644 --- a/src/CloudPDF/Types/DocPagesRotate404ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesRotate404ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesRotate404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesRotate404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesRotate404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesRotate404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesRotate404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesRotate404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesRotate404ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesRotate404ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesSetName200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocPagesSetName200ResponseMetaCacheDelta.cs index a478d87..1eed97d 100644 --- a/src/CloudPDF/Types/DocPagesSetName200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocPagesSetName200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocPagesSetName200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocPagesSetName400ResponseCode.cs b/src/CloudPDF/Types/DocPagesSetName400ResponseCode.cs index 06b1343..296bf64 100644 --- a/src/CloudPDF/Types/DocPagesSetName400ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesSetName400ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesSetName400ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesSetName400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesSetName400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesSetName400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesSetName400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesSetName400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesSetName400ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesSetName400ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocPagesSetName404ResponseCode.cs b/src/CloudPDF/Types/DocPagesSetName404ResponseCode.cs index 584cd63..1b36c96 100644 --- a/src/CloudPDF/Types/DocPagesSetName404ResponseCode.cs +++ b/src/CloudPDF/Types/DocPagesSetName404ResponseCode.cs @@ -64,6 +64,28 @@ namespace CloudPDF; public static readonly DocPagesSetName404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocPagesSetName404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocPagesSetName404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocPagesSetName404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocPagesSetName404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocPagesSetName404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocPagesSetName404ResponseCode StaleBase = new(Values.StaleBase); + public DocPagesSetName404ResponseCode(string value) { Value = value; @@ -198,5 +220,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocRedactionsApply200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocRedactionsApply200ResponseMetaCacheDelta.cs index a983ed5..1bb9226 100644 --- a/src/CloudPDF/Types/DocRedactionsApply200ResponseMetaCacheDelta.cs +++ b/src/CloudPDF/Types/DocRedactionsApply200ResponseMetaCacheDelta.cs @@ -20,6 +20,12 @@ public record DocRedactionsApply200ResponseMetaCacheDelta : IJsonOnDeserialized [JsonPropertyName("annotationsVersion")] public int? AnnotationsVersion { get; set; } + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + [JsonPropertyName("pages")] public IEnumerable Pages { get; set; } = new List(); diff --git a/src/CloudPDF/Types/DocRedactionsApply400ResponseCode.cs b/src/CloudPDF/Types/DocRedactionsApply400ResponseCode.cs index 0bc54d1..cce91f1 100644 --- a/src/CloudPDF/Types/DocRedactionsApply400ResponseCode.cs +++ b/src/CloudPDF/Types/DocRedactionsApply400ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocRedactionsApply400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocRedactionsApply400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocRedactionsApply400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocRedactionsApply400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocRedactionsApply400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocRedactionsApply400ResponseCode StaleBase = new(Values.StaleBase); + public DocRedactionsApply400ResponseCode(string value) { Value = value; @@ -204,5 +226,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocRedactionsApply404ResponseCode.cs b/src/CloudPDF/Types/DocRedactionsApply404ResponseCode.cs index 2e98937..5d29f5a 100644 --- a/src/CloudPDF/Types/DocRedactionsApply404ResponseCode.cs +++ b/src/CloudPDF/Types/DocRedactionsApply404ResponseCode.cs @@ -70,6 +70,28 @@ namespace CloudPDF; Values.MalformedPdf ); + public static readonly DocRedactionsApply404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocRedactionsApply404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocRedactionsApply404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocRedactionsApply404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocRedactionsApply404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocRedactionsApply404ResponseCode StaleBase = new(Values.StaleBase); + public DocRedactionsApply404ResponseCode(string value) { Value = value; @@ -204,5 +226,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocRenderResponseCode.cs b/src/CloudPDF/Types/DocRenderResponseCode.cs index 2687239..5e7c6ce 100644 --- a/src/CloudPDF/Types/DocRenderResponseCode.cs +++ b/src/CloudPDF/Types/DocRenderResponseCode.cs @@ -58,6 +58,20 @@ namespace CloudPDF; public static readonly DocRenderResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocRenderResponseCode SigningPending = new(Values.SigningPending); + + public static readonly DocRenderResponseCode SigningExpired = new(Values.SigningExpired); + + public static readonly DocRenderResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocRenderResponseCode SignatureRefused = new(Values.SignatureRefused); + + public static readonly DocRenderResponseCode ProtectedDocument = new(Values.ProtectedDocument); + + public static readonly DocRenderResponseCode StaleBase = new(Values.StaleBase); + public DocRenderResponseCode(string value) { Value = value; @@ -191,5 +205,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocSignaturesAbort200Response.cs b/src/CloudPDF/Types/DocSignaturesAbort200Response.cs new file mode 100644 index 0000000..956505e --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAbort200Response.cs @@ -0,0 +1,28 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAbort200Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("status")] + public required DocSignaturesAbort200ResponseStatus Status { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAbort200ResponseStatus.cs b/src/CloudPDF/Types/DocSignaturesAbort200ResponseStatus.cs new file mode 100644 index 0000000..d7e8938 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAbort200ResponseStatus.cs @@ -0,0 +1,125 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAbort200ResponseStatus.DocSignaturesAbort200ResponseStatusSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAbort200ResponseStatus : IStringEnum +{ + public static readonly DocSignaturesAbort200ResponseStatus Aborted = new(Values.Aborted); + + public static readonly DocSignaturesAbort200ResponseStatus AlreadyCompleted = new( + Values.AlreadyCompleted + ); + + public static readonly DocSignaturesAbort200ResponseStatus Unknown = new(Values.Unknown); + + public DocSignaturesAbort200ResponseStatus(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAbort200ResponseStatus FromCustom(string value) + { + return new DocSignaturesAbort200ResponseStatus(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesAbort200ResponseStatus value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesAbort200ResponseStatus value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAbort200ResponseStatus value) => + value.Value; + + public static explicit operator DocSignaturesAbort200ResponseStatus(string value) => new(value); + + internal class DocSignaturesAbort200ResponseStatusSerializer + : JsonConverter + { + public override DocSignaturesAbort200ResponseStatus Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAbort200ResponseStatus(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAbort200ResponseStatus value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAbort200ResponseStatus ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAbort200ResponseStatus(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAbort200ResponseStatus value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Aborted = "aborted"; + + public const string AlreadyCompleted = "already-completed"; + + public const string Unknown = "unknown"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAbort404Response.cs b/src/CloudPDF/Types/DocSignaturesAbort404Response.cs new file mode 100644 index 0000000..e570a32 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAbort404Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAbort404Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocSignaturesAbort404ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocSignaturesAbort404ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAbort404ResponseCode.cs b/src/CloudPDF/Types/DocSignaturesAbort404ResponseCode.cs new file mode 100644 index 0000000..7bf6474 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAbort404ResponseCode.cs @@ -0,0 +1,242 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAbort404ResponseCode.DocSignaturesAbort404ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAbort404ResponseCode : IStringEnum +{ + public static readonly DocSignaturesAbort404ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocSignaturesAbort404ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocSignaturesAbort404ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocSignaturesAbort404ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocSignaturesAbort404ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocSignaturesAbort404ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocSignaturesAbort404ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocSignaturesAbort404ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocSignaturesAbort404ResponseCode Network = new(Values.Network); + + public static readonly DocSignaturesAbort404ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocSignaturesAbort404ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocSignaturesAbort404ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocSignaturesAbort404ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocSignaturesAbort404ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocSignaturesAbort404ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocSignaturesAbort404ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocSignaturesAbort404ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocSignaturesAbort404ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocSignaturesAbort404ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocSignaturesAbort404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocSignaturesAbort404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocSignaturesAbort404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocSignaturesAbort404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocSignaturesAbort404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocSignaturesAbort404ResponseCode StaleBase = new(Values.StaleBase); + + public DocSignaturesAbort404ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAbort404ResponseCode FromCustom(string value) + { + return new DocSignaturesAbort404ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesAbort404ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesAbort404ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAbort404ResponseCode value) => value.Value; + + public static explicit operator DocSignaturesAbort404ResponseCode(string value) => new(value); + + internal class DocSignaturesAbort404ResponseCodeSerializer + : JsonConverter + { + public override DocSignaturesAbort404ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAbort404ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAbort404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAbort404ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAbort404ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAbort404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAbort404ResponseName.cs b/src/CloudPDF/Types/DocSignaturesAbort404ResponseName.cs new file mode 100644 index 0000000..12ff0f7 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAbort404ResponseName.cs @@ -0,0 +1,114 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAbort404ResponseName.DocSignaturesAbort404ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAbort404ResponseName : IStringEnum +{ + public static readonly DocSignaturesAbort404ResponseName EngineError = new(Values.EngineError); + + public DocSignaturesAbort404ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAbort404ResponseName FromCustom(string value) + { + return new DocSignaturesAbort404ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesAbort404ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesAbort404ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAbort404ResponseName value) => value.Value; + + public static explicit operator DocSignaturesAbort404ResponseName(string value) => new(value); + + internal class DocSignaturesAbort404ResponseNameSerializer + : JsonConverter + { + public override DocSignaturesAbort404ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAbort404ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAbort404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAbort404ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAbort404ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAbort404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200Response.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200Response.cs new file mode 100644 index 0000000..8434a47 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200Response.cs @@ -0,0 +1,56 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis200Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("mode")] + public required DocSignaturesAnalysis200ResponseMode Mode { get; set; } + + [JsonPropertyName("policyVersion")] + public required int PolicyVersion { get; set; } + + [JsonPropertyName("basis")] + public required DocSignaturesAnalysis200ResponseBasis Basis { get; set; } + + [JsonPropertyName("since")] + public required DocSignaturesAnalysis200ResponseSince Since { get; set; } + + [JsonPropertyName("until")] + public required DocSignaturesAnalysis200ResponseUntil Until { get; set; } + + [JsonPropertyName("restrictions")] + public IEnumerable Restrictions { get; set; } = + new List(); + + [JsonPropertyName("current")] + public required DocSignaturesAnalysis200ResponseCurrent Current { get; set; } + + [JsonPropertyName("later")] + public required DocSignaturesAnalysis200ResponseLater Later { get; set; } + + [JsonPropertyName("verdict")] + public required DocSignaturesAnalysis200ResponseVerdict Verdict { get; set; } + + [JsonPropertyName("steps")] + public IEnumerable Steps { get; set; } = new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasis.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasis.cs new file mode 100644 index 0000000..3c68548 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasis.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis200ResponseBasis : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("version")] + public required DocSignaturesAnalysis200ResponseBasisVersion Version { get; set; } + + [JsonPropertyName("editsVersion")] + public required int EditsVersion { get; set; } + + [JsonPropertyName("source")] + public required DocSignaturesAnalysis200ResponseBasisSource Source { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasisSource.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasisSource.cs new file mode 100644 index 0000000..e545e1f --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasisSource.cs @@ -0,0 +1,128 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis200ResponseBasisSource.DocSignaturesAnalysis200ResponseBasisSourceSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis200ResponseBasisSource : IStringEnum +{ + public static readonly DocSignaturesAnalysis200ResponseBasisSource Persisted = new( + Values.Persisted + ); + + public static readonly DocSignaturesAnalysis200ResponseBasisSource WorkingCopy = new( + Values.WorkingCopy + ); + + public DocSignaturesAnalysis200ResponseBasisSource(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis200ResponseBasisSource FromCustom(string value) + { + return new DocSignaturesAnalysis200ResponseBasisSource(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesAnalysis200ResponseBasisSource value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesAnalysis200ResponseBasisSource value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAnalysis200ResponseBasisSource value) => + value.Value; + + public static explicit operator DocSignaturesAnalysis200ResponseBasisSource(string value) => + new(value); + + internal class DocSignaturesAnalysis200ResponseBasisSourceSerializer + : JsonConverter + { + public override DocSignaturesAnalysis200ResponseBasisSource Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseBasisSource(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseBasisSource value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis200ResponseBasisSource ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseBasisSource(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseBasisSource value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Persisted = "persisted"; + + public const string WorkingCopy = "working-copy"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasisVersion.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasisVersion.cs new file mode 100644 index 0000000..8eb6583 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseBasisVersion.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis200ResponseBasisVersion : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("sha256")] + public required string Sha256 { get; set; } + + [JsonPropertyName("byteLength")] + public required int ByteLength { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrent.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrent.cs new file mode 100644 index 0000000..093d868 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrent.cs @@ -0,0 +1,41 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis200ResponseCurrent : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("verdict")] + public required DocSignaturesAnalysis200ResponseCurrentVerdict Verdict { get; set; } + + [JsonPropertyName("complete")] + public required bool Complete { get; set; } + + [JsonPropertyName("primary")] + public DocSignaturesAnalysis200ResponseCurrentPrimary? Primary { get; set; } + + [JsonPropertyName("findings")] + public IEnumerable Findings { get; set; } = + new List(); + + [JsonPropertyName("method")] + public required DocSignaturesAnalysis200ResponseCurrentMethod Method { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItem.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItem.cs new file mode 100644 index 0000000..ba4bb68 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItem.cs @@ -0,0 +1,40 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis200ResponseCurrentFindingsItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("rule")] + public required string Rule { get; set; } + + [JsonPropertyName("verdict")] + public required DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict Verdict { get; set; } + + [JsonPropertyName("objectNumber")] + public required int ObjectNumber { get; set; } + + [JsonPropertyName("edge")] + public string? Edge { get; set; } + + [JsonPropertyName("detail")] + public string? Detail { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict.cs new file mode 100644 index 0000000..35bd422 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict.DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdictSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict + : IStringEnum +{ + public static readonly DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict Permitted = + new(Values.Permitted); + + public static readonly DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict Forbidden = + new(Values.Forbidden); + + public static readonly DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict Incomplete = + new(Values.Incomplete); + + public DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict FromCustom( + string value + ) + { + return new DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict value + ) => value.Value; + + public static explicit operator DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict( + string value + ) => new(value); + + internal class DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdictSerializer + : JsonConverter + { + public override DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Permitted = "permitted"; + + public const string Forbidden = "forbidden"; + + public const string Incomplete = "incomplete"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentMethod.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentMethod.cs new file mode 100644 index 0000000..5b32eba --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentMethod.cs @@ -0,0 +1,128 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis200ResponseCurrentMethod.DocSignaturesAnalysis200ResponseCurrentMethodSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis200ResponseCurrentMethod : IStringEnum +{ + public static readonly DocSignaturesAnalysis200ResponseCurrentMethod NetState = new( + Values.NetState + ); + + public static readonly DocSignaturesAnalysis200ResponseCurrentMethod NetStateReplay = new( + Values.NetStateReplay + ); + + public DocSignaturesAnalysis200ResponseCurrentMethod(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis200ResponseCurrentMethod FromCustom(string value) + { + return new DocSignaturesAnalysis200ResponseCurrentMethod(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesAnalysis200ResponseCurrentMethod value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesAnalysis200ResponseCurrentMethod value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAnalysis200ResponseCurrentMethod value) => + value.Value; + + public static explicit operator DocSignaturesAnalysis200ResponseCurrentMethod(string value) => + new(value); + + internal class DocSignaturesAnalysis200ResponseCurrentMethodSerializer + : JsonConverter + { + public override DocSignaturesAnalysis200ResponseCurrentMethod Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseCurrentMethod(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseCurrentMethod value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis200ResponseCurrentMethod ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseCurrentMethod(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseCurrentMethod value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string NetState = "net-state"; + + public const string NetStateReplay = "net-state+replay"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentPrimary.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentPrimary.cs new file mode 100644 index 0000000..c8725ab --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentPrimary.cs @@ -0,0 +1,40 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis200ResponseCurrentPrimary : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("rule")] + public required string Rule { get; set; } + + [JsonPropertyName("verdict")] + public required DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict Verdict { get; set; } + + [JsonPropertyName("objectNumber")] + public required int ObjectNumber { get; set; } + + [JsonPropertyName("edge")] + public string? Edge { get; set; } + + [JsonPropertyName("detail")] + public string? Detail { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict.cs new file mode 100644 index 0000000..94e3f6b --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict.DocSignaturesAnalysis200ResponseCurrentPrimaryVerdictSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict : IStringEnum +{ + public static readonly DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict Permitted = new( + Values.Permitted + ); + + public static readonly DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict Forbidden = new( + Values.Forbidden + ); + + public static readonly DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict Incomplete = new( + Values.Incomplete + ); + + public DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict FromCustom(string value) + { + return new DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict value + ) => value.Value; + + public static explicit operator DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict( + string value + ) => new(value); + + internal class DocSignaturesAnalysis200ResponseCurrentPrimaryVerdictSerializer + : JsonConverter + { + public override DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Permitted = "permitted"; + + public const string Forbidden = "forbidden"; + + public const string Incomplete = "incomplete"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentVerdict.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentVerdict.cs new file mode 100644 index 0000000..d744708 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseCurrentVerdict.cs @@ -0,0 +1,140 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis200ResponseCurrentVerdict.DocSignaturesAnalysis200ResponseCurrentVerdictSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis200ResponseCurrentVerdict : IStringEnum +{ + public static readonly DocSignaturesAnalysis200ResponseCurrentVerdict Unchanged = new( + Values.Unchanged + ); + + public static readonly DocSignaturesAnalysis200ResponseCurrentVerdict Permitted = new( + Values.Permitted + ); + + public static readonly DocSignaturesAnalysis200ResponseCurrentVerdict Forbidden = new( + Values.Forbidden + ); + + public static readonly DocSignaturesAnalysis200ResponseCurrentVerdict Indeterminate = new( + Values.Indeterminate + ); + + public DocSignaturesAnalysis200ResponseCurrentVerdict(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis200ResponseCurrentVerdict FromCustom(string value) + { + return new DocSignaturesAnalysis200ResponseCurrentVerdict(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesAnalysis200ResponseCurrentVerdict value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesAnalysis200ResponseCurrentVerdict value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAnalysis200ResponseCurrentVerdict value) => + value.Value; + + public static explicit operator DocSignaturesAnalysis200ResponseCurrentVerdict(string value) => + new(value); + + internal class DocSignaturesAnalysis200ResponseCurrentVerdictSerializer + : JsonConverter + { + public override DocSignaturesAnalysis200ResponseCurrentVerdict Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseCurrentVerdict(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseCurrentVerdict value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis200ResponseCurrentVerdict ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseCurrentVerdict(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseCurrentVerdict value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unchanged = "unchanged"; + + public const string Permitted = "permitted"; + + public const string Forbidden = "forbidden"; + + public const string Indeterminate = "indeterminate"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseLater.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseLater.cs new file mode 100644 index 0000000..36f7cf5 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseLater.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis200ResponseLater : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("revisionCount")] + public required int RevisionCount { get; set; } + + [JsonPropertyName("undoneObjectNumbers")] + public IEnumerable UndoneObjectNumbers { get; set; } = new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseMode.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseMode.cs new file mode 100644 index 0000000..5c4570d --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseMode.cs @@ -0,0 +1,124 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis200ResponseMode.DocSignaturesAnalysis200ResponseModeSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis200ResponseMode : IStringEnum +{ + public static readonly DocSignaturesAnalysis200ResponseMode Authoritative = new( + Values.Authoritative + ); + + public static readonly DocSignaturesAnalysis200ResponseMode Exploratory = new( + Values.Exploratory + ); + + public DocSignaturesAnalysis200ResponseMode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis200ResponseMode FromCustom(string value) + { + return new DocSignaturesAnalysis200ResponseMode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesAnalysis200ResponseMode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesAnalysis200ResponseMode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAnalysis200ResponseMode value) => + value.Value; + + public static explicit operator DocSignaturesAnalysis200ResponseMode(string value) => + new(value); + + internal class DocSignaturesAnalysis200ResponseModeSerializer + : JsonConverter + { + public override DocSignaturesAnalysis200ResponseMode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseMode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseMode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis200ResponseMode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseMode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseMode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Authoritative = "authoritative"; + + public const string Exploratory = "exploratory"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseRestrictionsItem.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseRestrictionsItem.cs new file mode 100644 index 0000000..024ffac --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseRestrictionsItem.cs @@ -0,0 +1,43 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis200ResponseRestrictionsItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("signatureIndex")] + public required int SignatureIndex { get; set; } + + [JsonPropertyName("revisionIndex")] + public required int RevisionIndex { get; set; } + + [JsonPropertyName("source")] + public required DocSignaturesAnalysis200ResponseRestrictionsItemSource Source { get; set; } + + [JsonPropertyName("own")] + public required bool Own { get; set; } + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonPropertyName("fields")] + public object? Fields { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseRestrictionsItemSource.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseRestrictionsItemSource.cs new file mode 100644 index 0000000..b742ad7 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseRestrictionsItemSource.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis200ResponseRestrictionsItemSource.DocSignaturesAnalysis200ResponseRestrictionsItemSourceSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis200ResponseRestrictionsItemSource : IStringEnum +{ + public static readonly DocSignaturesAnalysis200ResponseRestrictionsItemSource Docmdp = new( + Values.Docmdp + ); + + public static readonly DocSignaturesAnalysis200ResponseRestrictionsItemSource Fieldmdp = new( + Values.Fieldmdp + ); + + public static readonly DocSignaturesAnalysis200ResponseRestrictionsItemSource Lock = new( + Values.Lock + ); + + public DocSignaturesAnalysis200ResponseRestrictionsItemSource(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis200ResponseRestrictionsItemSource FromCustom(string value) + { + return new DocSignaturesAnalysis200ResponseRestrictionsItemSource(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesAnalysis200ResponseRestrictionsItemSource value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesAnalysis200ResponseRestrictionsItemSource value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesAnalysis200ResponseRestrictionsItemSource value + ) => value.Value; + + public static explicit operator DocSignaturesAnalysis200ResponseRestrictionsItemSource( + string value + ) => new(value); + + internal class DocSignaturesAnalysis200ResponseRestrictionsItemSourceSerializer + : JsonConverter + { + public override DocSignaturesAnalysis200ResponseRestrictionsItemSource Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseRestrictionsItemSource(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseRestrictionsItemSource value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis200ResponseRestrictionsItemSource ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseRestrictionsItemSource(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseRestrictionsItemSource value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Docmdp = "docmdp"; + + public const string Fieldmdp = "fieldmdp"; + + public const string Lock = "lock"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseSince.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseSince.cs new file mode 100644 index 0000000..0451f64 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseSince.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis200ResponseSince : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("revisionIndex")] + public required int RevisionIndex { get; set; } + + [JsonPropertyName("signatureIndex")] + public int? SignatureIndex { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseUntil.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseUntil.cs new file mode 100644 index 0000000..13bfe78 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseUntil.cs @@ -0,0 +1,28 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis200ResponseUntil : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("revisionIndex")] + public required int RevisionIndex { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseVerdict.cs b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseVerdict.cs new file mode 100644 index 0000000..2d078e2 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis200ResponseVerdict.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis200ResponseVerdict.DocSignaturesAnalysis200ResponseVerdictSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis200ResponseVerdict : IStringEnum +{ + public static readonly DocSignaturesAnalysis200ResponseVerdict Unchanged = new( + Values.Unchanged + ); + + public static readonly DocSignaturesAnalysis200ResponseVerdict Permitted = new( + Values.Permitted + ); + + public static readonly DocSignaturesAnalysis200ResponseVerdict Forbidden = new( + Values.Forbidden + ); + + public static readonly DocSignaturesAnalysis200ResponseVerdict Indeterminate = new( + Values.Indeterminate + ); + + public DocSignaturesAnalysis200ResponseVerdict(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis200ResponseVerdict FromCustom(string value) + { + return new DocSignaturesAnalysis200ResponseVerdict(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesAnalysis200ResponseVerdict value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesAnalysis200ResponseVerdict value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAnalysis200ResponseVerdict value) => + value.Value; + + public static explicit operator DocSignaturesAnalysis200ResponseVerdict(string value) => + new(value); + + internal class DocSignaturesAnalysis200ResponseVerdictSerializer + : JsonConverter + { + public override DocSignaturesAnalysis200ResponseVerdict Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseVerdict(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseVerdict value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis200ResponseVerdict ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis200ResponseVerdict(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis200ResponseVerdict value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unchanged = "unchanged"; + + public const string Permitted = "permitted"; + + public const string Forbidden = "forbidden"; + + public const string Indeterminate = "indeterminate"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis400Response.cs b/src/CloudPDF/Types/DocSignaturesAnalysis400Response.cs new file mode 100644 index 0000000..b73c5cf --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis400Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis400Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocSignaturesAnalysis400ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocSignaturesAnalysis400ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis400ResponseCode.cs b/src/CloudPDF/Types/DocSignaturesAnalysis400ResponseCode.cs new file mode 100644 index 0000000..08a36c4 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis400ResponseCode.cs @@ -0,0 +1,244 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis400ResponseCode.DocSignaturesAnalysis400ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis400ResponseCode : IStringEnum +{ + public static readonly DocSignaturesAnalysis400ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocSignaturesAnalysis400ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocSignaturesAnalysis400ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocSignaturesAnalysis400ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocSignaturesAnalysis400ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocSignaturesAnalysis400ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocSignaturesAnalysis400ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocSignaturesAnalysis400ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocSignaturesAnalysis400ResponseCode Network = new(Values.Network); + + public static readonly DocSignaturesAnalysis400ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocSignaturesAnalysis400ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocSignaturesAnalysis400ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocSignaturesAnalysis400ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocSignaturesAnalysis400ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocSignaturesAnalysis400ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocSignaturesAnalysis400ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocSignaturesAnalysis400ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocSignaturesAnalysis400ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocSignaturesAnalysis400ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocSignaturesAnalysis400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocSignaturesAnalysis400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocSignaturesAnalysis400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocSignaturesAnalysis400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocSignaturesAnalysis400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocSignaturesAnalysis400ResponseCode StaleBase = new(Values.StaleBase); + + public DocSignaturesAnalysis400ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis400ResponseCode FromCustom(string value) + { + return new DocSignaturesAnalysis400ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesAnalysis400ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesAnalysis400ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAnalysis400ResponseCode value) => + value.Value; + + public static explicit operator DocSignaturesAnalysis400ResponseCode(string value) => + new(value); + + internal class DocSignaturesAnalysis400ResponseCodeSerializer + : JsonConverter + { + public override DocSignaturesAnalysis400ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis400ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis400ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis400ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis400ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis400ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis400ResponseName.cs b/src/CloudPDF/Types/DocSignaturesAnalysis400ResponseName.cs new file mode 100644 index 0000000..a995b2b --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis400ResponseName.cs @@ -0,0 +1,118 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis400ResponseName.DocSignaturesAnalysis400ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis400ResponseName : IStringEnum +{ + public static readonly DocSignaturesAnalysis400ResponseName EngineError = new( + Values.EngineError + ); + + public DocSignaturesAnalysis400ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis400ResponseName FromCustom(string value) + { + return new DocSignaturesAnalysis400ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesAnalysis400ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesAnalysis400ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAnalysis400ResponseName value) => + value.Value; + + public static explicit operator DocSignaturesAnalysis400ResponseName(string value) => + new(value); + + internal class DocSignaturesAnalysis400ResponseNameSerializer + : JsonConverter + { + public override DocSignaturesAnalysis400ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis400ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis400ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis400ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis400ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis400ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis404Response.cs b/src/CloudPDF/Types/DocSignaturesAnalysis404Response.cs new file mode 100644 index 0000000..aa02b2b --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis404Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesAnalysis404Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocSignaturesAnalysis404ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocSignaturesAnalysis404ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis404ResponseCode.cs b/src/CloudPDF/Types/DocSignaturesAnalysis404ResponseCode.cs new file mode 100644 index 0000000..871d010 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis404ResponseCode.cs @@ -0,0 +1,244 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis404ResponseCode.DocSignaturesAnalysis404ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis404ResponseCode : IStringEnum +{ + public static readonly DocSignaturesAnalysis404ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocSignaturesAnalysis404ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocSignaturesAnalysis404ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocSignaturesAnalysis404ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocSignaturesAnalysis404ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocSignaturesAnalysis404ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocSignaturesAnalysis404ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocSignaturesAnalysis404ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocSignaturesAnalysis404ResponseCode Network = new(Values.Network); + + public static readonly DocSignaturesAnalysis404ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocSignaturesAnalysis404ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocSignaturesAnalysis404ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocSignaturesAnalysis404ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocSignaturesAnalysis404ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocSignaturesAnalysis404ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocSignaturesAnalysis404ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocSignaturesAnalysis404ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocSignaturesAnalysis404ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocSignaturesAnalysis404ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocSignaturesAnalysis404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocSignaturesAnalysis404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocSignaturesAnalysis404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocSignaturesAnalysis404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocSignaturesAnalysis404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocSignaturesAnalysis404ResponseCode StaleBase = new(Values.StaleBase); + + public DocSignaturesAnalysis404ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis404ResponseCode FromCustom(string value) + { + return new DocSignaturesAnalysis404ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesAnalysis404ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesAnalysis404ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAnalysis404ResponseCode value) => + value.Value; + + public static explicit operator DocSignaturesAnalysis404ResponseCode(string value) => + new(value); + + internal class DocSignaturesAnalysis404ResponseCodeSerializer + : JsonConverter + { + public override DocSignaturesAnalysis404ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis404ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis404ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis404ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesAnalysis404ResponseName.cs b/src/CloudPDF/Types/DocSignaturesAnalysis404ResponseName.cs new file mode 100644 index 0000000..1551c69 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesAnalysis404ResponseName.cs @@ -0,0 +1,118 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesAnalysis404ResponseName.DocSignaturesAnalysis404ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesAnalysis404ResponseName : IStringEnum +{ + public static readonly DocSignaturesAnalysis404ResponseName EngineError = new( + Values.EngineError + ); + + public DocSignaturesAnalysis404ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesAnalysis404ResponseName FromCustom(string value) + { + return new DocSignaturesAnalysis404ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesAnalysis404ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesAnalysis404ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesAnalysis404ResponseName value) => + value.Value; + + public static explicit operator DocSignaturesAnalysis404ResponseName(string value) => + new(value); + + internal class DocSignaturesAnalysis404ResponseNameSerializer + : JsonConverter + { + public override DocSignaturesAnalysis404ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesAnalysis404ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesAnalysis404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesAnalysis404ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesAnalysis404ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesAnalysis404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200Response.cs b/src/CloudPDF/Types/DocSignaturesComplete200Response.cs new file mode 100644 index 0000000..3154de3 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200Response.cs @@ -0,0 +1,43 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("status")] + public required DocSignaturesComplete200ResponseStatus Status { get; set; } + + [JsonPropertyName("signature")] + public required DocSignaturesComplete200ResponseSignature Signature { get; set; } + + [JsonPropertyName("version")] + public required DocSignaturesComplete200ResponseVersion Version { get; set; } + + [JsonPropertyName("previous")] + public required DocSignaturesComplete200ResponsePrevious Previous { get; set; } + + [JsonPropertyName("protection")] + public required DocSignaturesComplete200ResponseProtection Protection { get; set; } + + [JsonPropertyName("meta")] + public required DocSignaturesComplete200ResponseMeta Meta { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseMeta.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMeta.cs new file mode 100644 index 0000000..1891b25 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMeta.cs @@ -0,0 +1,32 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseMeta : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("affectedPages")] + public IEnumerable AffectedPages { get; set; } = + new List(); + + [JsonPropertyName("cacheDelta")] + public DocSignaturesComplete200ResponseMetaCacheDelta? CacheDelta { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItem.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItem.cs new file mode 100644 index 0000000..7201285 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItem.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseMetaAffectedPagesItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("pageObjectNumber")] + public required int PageObjectNumber { get; set; } + + [JsonPropertyName("revision")] + public required DocSignaturesComplete200ResponseMetaAffectedPagesItemRevision Revision { get; set; } + + [JsonPropertyName("weakAnnotationState")] + public required DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState WeakAnnotationState { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemRevision.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemRevision.cs new file mode 100644 index 0000000..3119165 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemRevision.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseMetaAffectedPagesItemRevision : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("docSessionId")] + public required string DocSessionId { get; set; } + + [JsonPropertyName("pageObjectNumber")] + public required int PageObjectNumber { get; set; } + + [JsonPropertyName("generation")] + public required int Generation { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.cs new file mode 100644 index 0000000..037a95d --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.cs @@ -0,0 +1,330 @@ +// ReSharper disable NullableWarningSuppressionIsUsed +// ReSharper disable InconsistentNaming + +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Nodes; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.JsonConverter) +)] +[Serializable] +public record DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState +{ + internal DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState( + string type, + object? value + ) + { + Kind = type; + Value = value; + } + + /// + /// Create an instance of DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState with . + /// + public DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState( + DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.Unknown value + ) + { + Kind = "unknown"; + Value = value.Value; + } + + /// + /// Create an instance of DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState with . + /// + public DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState( + DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.Known value + ) + { + Kind = "known"; + Value = value.Value; + } + + /// + /// Discriminant value + /// + [JsonPropertyName("kind")] + public string Kind { get; internal set; } + + /// + /// Discriminated union value + /// + public object? Value { get; internal set; } + + /// + /// Returns true if is "unknown" + /// + public bool IsUnknown => Kind == "unknown"; + + /// + /// Returns true if is "known" + /// + public bool IsKnown => Kind == "known"; + + /// + /// Returns the value as a if is 'unknown', otherwise throws an exception. + /// + /// Thrown when is not 'unknown'. + public CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown AsUnknown() => + IsUnknown + ? (CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown) + Value! + : throw new global::System.Exception( + "DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.Kind is not 'unknown'" + ); + + /// + /// Returns the value as a if is 'known', otherwise throws an exception. + /// + /// Thrown when is not 'known'. + public CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown AsKnown() => + IsKnown + ? (CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown) + Value! + : throw new global::System.Exception( + "DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.Kind is not 'known'" + ); + + public T Match( + Func< + CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown, + T + > onUnknown, + Func< + CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown, + T + > onKnown, + Func onUnknown_ + ) + { + return Kind switch + { + "unknown" => onUnknown(AsUnknown()), + "known" => onKnown(AsKnown()), + _ => onUnknown_(Kind, Value), + }; + } + + public void Visit( + Action onUnknown, + Action onKnown, + Action onUnknown_ + ) + { + switch (Kind) + { + case "unknown": + onUnknown(AsUnknown()); + break; + case "known": + onKnown(AsKnown()); + break; + default: + onUnknown_(Kind, Value); + break; + } + } + + /// + /// Attempts to cast the value to a and returns true if successful. + /// + public bool TryAsUnknown( + out CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown? value + ) + { + if (Kind == "unknown") + { + value = + (CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown) + Value!; + return true; + } + value = null; + return false; + } + + /// + /// Attempts to cast the value to a and returns true if successful. + /// + public bool TryAsKnown( + out CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown? value + ) + { + if (Kind == "known") + { + value = + (CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown) + Value!; + return true; + } + value = null; + return false; + } + + public override string ToString() => JsonUtils.Serialize(this); + + public static implicit operator DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState( + DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.Unknown value + ) => new(value); + + public static implicit operator DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState( + DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.Known value + ) => new(value); + + [Serializable] + internal sealed class JsonConverter + : JsonConverter + { + public override bool CanConvert(global::System.Type typeToConvert) => + typeof(DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState).IsAssignableFrom( + typeToConvert + ); + + public override DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var json = JsonElement.ParseValue(ref reader); + if (!json.TryGetProperty("kind", out var discriminatorElement)) + { + throw new JsonException("Missing discriminator property 'kind'"); + } + if (discriminatorElement.ValueKind != JsonValueKind.String) + { + if (discriminatorElement.ValueKind == JsonValueKind.Null) + { + throw new JsonException("Discriminator property 'kind' is null"); + } + + throw new JsonException( + $"Discriminator property 'kind' is not a string, instead is {discriminatorElement.ToString()}" + ); + } + + var discriminator = + discriminatorElement.GetString() + ?? throw new JsonException("Discriminator property 'kind' is null"); + + // Strip the discriminant property to prevent it from leaking into AdditionalProperties + var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); + jsonObject?.Remove("kind"); + var jsonWithoutDiscriminator = + jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; + + var value = discriminator switch + { + "unknown" => + jsonWithoutDiscriminator.Deserialize( + options + ) + ?? throw new JsonException( + "Failed to deserialize CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown" + ), + "known" => + jsonWithoutDiscriminator.Deserialize( + options + ) + ?? throw new JsonException( + "Failed to deserialize CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown" + ), + _ => json.Deserialize(options), + }; + return new DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState( + discriminator, + value + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState value, + JsonSerializerOptions options + ) + { + JsonNode json = + value.Kind switch + { + "unknown" => JsonSerializer.SerializeToNode(value.Value, options), + "known" => JsonSerializer.SerializeToNode(value.Value, options), + _ => JsonSerializer.SerializeToNode(value.Value, options), + } ?? new JsonObject(); + json["kind"] = value.Kind; + json.WriteTo(writer, options); + } + + public override DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState ReadAsPropertyName( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new JsonException("The JSON property name could not be read as a string."); + return new DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState( + stringValue, + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Kind); + } + } + + /// + /// Discriminated union type for unknown + /// + [Serializable] + public struct Unknown + { + public Unknown( + CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown value + ) + { + Value = value; + } + + internal CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown Value { get; set; } + + public override string ToString() => Value.ToString() ?? "null"; + + public static implicit operator DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.Unknown( + CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown value + ) => new(value); + } + + /// + /// Discriminated union type for known + /// + [Serializable] + public struct Known + { + public Known( + CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown value + ) + { + Value = value; + } + + internal CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown Value { get; set; } + + public override string ToString() => Value.ToString() ?? "null"; + + public static implicit operator DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.Known( + CloudPDF.DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown value + ) => new(value); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.cs new file mode 100644 index 0000000..e07b6d6 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.cs @@ -0,0 +1,29 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("hasAnyWeakAnnotations")] + public required bool HasAnyWeakAnnotations { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.cs new file mode 100644 index 0000000..799b853 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.cs @@ -0,0 +1,26 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown + : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDelta.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDelta.cs new file mode 100644 index 0000000..dfc23e2 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDelta.cs @@ -0,0 +1,44 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseMetaCacheDelta : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("previousDocVersion")] + public required int PreviousDocVersion { get; set; } + + [JsonPropertyName("docVersion")] + public required int DocVersion { get; set; } + + [JsonPropertyName("annotationsVersion")] + public int? AnnotationsVersion { get; set; } + + [JsonPropertyName("layerVersion")] + public int? LayerVersion { get; set; } + + [JsonPropertyName("working")] + public bool? Working { get; set; } + + [JsonPropertyName("pages")] + public IEnumerable Pages { get; set; } = + new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItem.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItem.cs new file mode 100644 index 0000000..190d282 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItem.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseMetaCacheDeltaPagesItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("pageObjectNumber")] + public required int PageObjectNumber { get; set; } + + [JsonPropertyName("cache")] + public required DocSignaturesComplete200ResponseMetaCacheDeltaPagesItemCache Cache { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItemCache.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItemCache.cs new file mode 100644 index 0000000..b9bc548 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItemCache.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseMetaCacheDeltaPagesItemCache : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("contentVersion")] + public required int ContentVersion { get; set; } + + [JsonPropertyName("annotationVersion")] + public required int AnnotationVersion { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponsePrevious.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponsePrevious.cs new file mode 100644 index 0000000..a937fd8 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponsePrevious.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponsePrevious : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("baseSha256")] + public required string BaseSha256 { get; set; } + + [JsonPropertyName("editsVersion")] + public required int EditsVersion { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtection.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtection.cs new file mode 100644 index 0000000..8f1e2aa --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtection.cs @@ -0,0 +1,41 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseProtection : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("enforced")] + public DocSignaturesComplete200ResponseProtectionEnforced? Enforced { get; set; } + + [JsonPropertyName("judged")] + public DocSignaturesComplete200ResponseProtectionJudged? Judged { get; set; } + + [JsonPropertyName("certification")] + public DocSignaturesComplete200ResponseProtectionCertification? Certification { get; set; } + + [JsonPropertyName("fieldLocks")] + public IEnumerable FieldLocks { get; set; } = + new List(); + + [JsonPropertyName("policyVersion")] + public required int PolicyVersion { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionCertification.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionCertification.cs new file mode 100644 index 0000000..36d80b1 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionCertification.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseProtectionCertification : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("signatureIndex")] + public required int SignatureIndex { get; set; } + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionEnforced.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionEnforced.cs new file mode 100644 index 0000000..efcc7aa --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionEnforced.cs @@ -0,0 +1,140 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete200ResponseProtectionEnforced.DocSignaturesComplete200ResponseProtectionEnforcedSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete200ResponseProtectionEnforced : IStringEnum +{ + public static readonly DocSignaturesComplete200ResponseProtectionEnforced None = new( + Values.None + ); + + public static readonly DocSignaturesComplete200ResponseProtectionEnforced Lta = new(Values.Lta); + + public static readonly DocSignaturesComplete200ResponseProtectionEnforced Fill = new( + Values.Fill + ); + + public static readonly DocSignaturesComplete200ResponseProtectionEnforced Annotate = new( + Values.Annotate + ); + + public DocSignaturesComplete200ResponseProtectionEnforced(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete200ResponseProtectionEnforced FromCustom(string value) + { + return new DocSignaturesComplete200ResponseProtectionEnforced(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesComplete200ResponseProtectionEnforced value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesComplete200ResponseProtectionEnforced value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesComplete200ResponseProtectionEnforced value + ) => value.Value; + + public static explicit operator DocSignaturesComplete200ResponseProtectionEnforced( + string value + ) => new(value); + + internal class DocSignaturesComplete200ResponseProtectionEnforcedSerializer + : JsonConverter + { + public override DocSignaturesComplete200ResponseProtectionEnforced Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete200ResponseProtectionEnforced(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseProtectionEnforced value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete200ResponseProtectionEnforced ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete200ResponseProtectionEnforced(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseProtectionEnforced value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string None = "none"; + + public const string Lta = "lta"; + + public const string Fill = "fill"; + + public const string Annotate = "annotate"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItem.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItem.cs new file mode 100644 index 0000000..64fdc68 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItem.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseProtectionFieldLocksItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("signatureIndex")] + public required int SignatureIndex { get; set; } + + [JsonPropertyName("source")] + public required DocSignaturesComplete200ResponseProtectionFieldLocksItemSource Source { get; set; } + + [JsonPropertyName("spec")] + public DocSignaturesComplete200ResponseProtectionFieldLocksItemSpec? Spec { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSource.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSource.cs new file mode 100644 index 0000000..991840e --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSource.cs @@ -0,0 +1,131 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete200ResponseProtectionFieldLocksItemSource.DocSignaturesComplete200ResponseProtectionFieldLocksItemSourceSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete200ResponseProtectionFieldLocksItemSource + : IStringEnum +{ + public static readonly DocSignaturesComplete200ResponseProtectionFieldLocksItemSource Fieldmdp = + new(Values.Fieldmdp); + + public static readonly DocSignaturesComplete200ResponseProtectionFieldLocksItemSource Lock = + new(Values.Lock); + + public DocSignaturesComplete200ResponseProtectionFieldLocksItemSource(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete200ResponseProtectionFieldLocksItemSource FromCustom( + string value + ) + { + return new DocSignaturesComplete200ResponseProtectionFieldLocksItemSource(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesComplete200ResponseProtectionFieldLocksItemSource value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesComplete200ResponseProtectionFieldLocksItemSource value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesComplete200ResponseProtectionFieldLocksItemSource value + ) => value.Value; + + public static explicit operator DocSignaturesComplete200ResponseProtectionFieldLocksItemSource( + string value + ) => new(value); + + internal class DocSignaturesComplete200ResponseProtectionFieldLocksItemSourceSerializer + : JsonConverter + { + public override DocSignaturesComplete200ResponseProtectionFieldLocksItemSource Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete200ResponseProtectionFieldLocksItemSource(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseProtectionFieldLocksItemSource value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete200ResponseProtectionFieldLocksItemSource ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete200ResponseProtectionFieldLocksItemSource(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseProtectionFieldLocksItemSource value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Fieldmdp = "fieldmdp"; + + public const string Lock = "lock"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSpec.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSpec.cs new file mode 100644 index 0000000..3686466 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSpec.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseProtectionFieldLocksItemSpec : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("action")] + public required DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction Action { get; set; } + + [JsonPropertyName("fields")] + public IEnumerable Fields { get; set; } = new List(); + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction.cs new file mode 100644 index 0000000..6b4b7cf --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction.cs @@ -0,0 +1,140 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction.DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecActionSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction + : IStringEnum +{ + public static readonly DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction All = + new(Values.All); + + public static readonly DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction Include = + new(Values.Include); + + public static readonly DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction Exclude = + new(Values.Exclude); + + public DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction FromCustom( + string value + ) + { + return new DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction value + ) => value.Value; + + public static explicit operator DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction( + string value + ) => new(value); + + internal class DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecActionSerializer + : JsonConverter + { + public override DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string All = "all"; + + public const string Include = "include"; + + public const string Exclude = "exclude"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionJudged.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionJudged.cs new file mode 100644 index 0000000..6aa0ce3 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseProtectionJudged.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete200ResponseProtectionJudged.DocSignaturesComplete200ResponseProtectionJudgedSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete200ResponseProtectionJudged : IStringEnum +{ + public static readonly DocSignaturesComplete200ResponseProtectionJudged None = new(Values.None); + + public static readonly DocSignaturesComplete200ResponseProtectionJudged Lta = new(Values.Lta); + + public static readonly DocSignaturesComplete200ResponseProtectionJudged Fill = new(Values.Fill); + + public static readonly DocSignaturesComplete200ResponseProtectionJudged Annotate = new( + Values.Annotate + ); + + public DocSignaturesComplete200ResponseProtectionJudged(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete200ResponseProtectionJudged FromCustom(string value) + { + return new DocSignaturesComplete200ResponseProtectionJudged(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesComplete200ResponseProtectionJudged value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesComplete200ResponseProtectionJudged value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesComplete200ResponseProtectionJudged value + ) => value.Value; + + public static explicit operator DocSignaturesComplete200ResponseProtectionJudged( + string value + ) => new(value); + + internal class DocSignaturesComplete200ResponseProtectionJudgedSerializer + : JsonConverter + { + public override DocSignaturesComplete200ResponseProtectionJudged Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete200ResponseProtectionJudged(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseProtectionJudged value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete200ResponseProtectionJudged ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete200ResponseProtectionJudged(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseProtectionJudged value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string None = "none"; + + public const string Lta = "lta"; + + public const string Fill = "fill"; + + public const string Annotate = "annotate"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignature.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignature.cs new file mode 100644 index 0000000..fa3ccba --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignature.cs @@ -0,0 +1,79 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseSignature : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("index")] + public required int Index { get; set; } + + [JsonPropertyName("field")] + public required DocSignaturesComplete200ResponseSignatureField Field { get; set; } + + [JsonPropertyName("fieldName")] + public required string FieldName { get; set; } + + [JsonPropertyName("widget")] + public DocSignaturesComplete200ResponseSignatureWidget? Widget { get; set; } + + [JsonPropertyName("signed")] + public required bool Signed { get; set; } + + [JsonPropertyName("kind")] + public required DocSignaturesComplete200ResponseSignatureKind Kind { get; set; } + + [JsonPropertyName("filter")] + public string? Filter { get; set; } + + [JsonPropertyName("subFilter")] + public string? SubFilter { get; set; } + + [JsonPropertyName("byteRange")] + public IEnumerable? ByteRange { get; set; } + + [JsonPropertyName("contentsSize")] + public required int ContentsSize { get; set; } + + [JsonPropertyName("coverage")] + public DocSignaturesComplete200ResponseSignatureCoverage? Coverage { get; set; } + + [JsonPropertyName("revisionIndex")] + public int? RevisionIndex { get; set; } + + [JsonPropertyName("signer")] + public required DocSignaturesComplete200ResponseSignatureSigner Signer { get; set; } + + [JsonPropertyName("docMdp")] + public double? DocMdp { get; set; } + + [JsonPropertyName("catalogCertification")] + public required bool CatalogCertification { get; set; } + + [JsonPropertyName("fieldMdp")] + public DocSignaturesComplete200ResponseSignatureFieldMdp? FieldMdp { get; set; } + + [JsonPropertyName("lock")] + public DocSignaturesComplete200ResponseSignatureLock? Lock { get; set; } + + [JsonPropertyName("seedValue")] + public DocSignaturesComplete200ResponseSignatureSeedValue? SeedValue { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureCoverage.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureCoverage.cs new file mode 100644 index 0000000..c546008 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureCoverage.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete200ResponseSignatureCoverage.DocSignaturesComplete200ResponseSignatureCoverageSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete200ResponseSignatureCoverage : IStringEnum +{ + public static readonly DocSignaturesComplete200ResponseSignatureCoverage WholeRevision = new( + Values.WholeRevision + ); + + public static readonly DocSignaturesComplete200ResponseSignatureCoverage Partial = new( + Values.Partial + ); + + public static readonly DocSignaturesComplete200ResponseSignatureCoverage Malformed = new( + Values.Malformed + ); + + public DocSignaturesComplete200ResponseSignatureCoverage(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete200ResponseSignatureCoverage FromCustom(string value) + { + return new DocSignaturesComplete200ResponseSignatureCoverage(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesComplete200ResponseSignatureCoverage value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesComplete200ResponseSignatureCoverage value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesComplete200ResponseSignatureCoverage value + ) => value.Value; + + public static explicit operator DocSignaturesComplete200ResponseSignatureCoverage( + string value + ) => new(value); + + internal class DocSignaturesComplete200ResponseSignatureCoverageSerializer + : JsonConverter + { + public override DocSignaturesComplete200ResponseSignatureCoverage Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete200ResponseSignatureCoverage(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseSignatureCoverage value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete200ResponseSignatureCoverage ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete200ResponseSignatureCoverage(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseSignatureCoverage value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string WholeRevision = "whole-revision"; + + public const string Partial = "partial"; + + public const string Malformed = "malformed"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureField.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureField.cs new file mode 100644 index 0000000..2de225c --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureField.cs @@ -0,0 +1,301 @@ +// ReSharper disable NullableWarningSuppressionIsUsed +// ReSharper disable InconsistentNaming + +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Nodes; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter(typeof(DocSignaturesComplete200ResponseSignatureField.JsonConverter))] +[Serializable] +public record DocSignaturesComplete200ResponseSignatureField +{ + internal DocSignaturesComplete200ResponseSignatureField(string type, object? value) + { + Kind = type; + Value = value; + } + + /// + /// Create an instance of DocSignaturesComplete200ResponseSignatureField with . + /// + public DocSignaturesComplete200ResponseSignatureField( + DocSignaturesComplete200ResponseSignatureField.ObjectNumber value + ) + { + Kind = "objectNumber"; + Value = value.Value; + } + + /// + /// Create an instance of DocSignaturesComplete200ResponseSignatureField with . + /// + public DocSignaturesComplete200ResponseSignatureField( + DocSignaturesComplete200ResponseSignatureField.Fqn value + ) + { + Kind = "fqn"; + Value = value.Value; + } + + /// + /// Discriminant value + /// + [JsonPropertyName("kind")] + public string Kind { get; internal set; } + + /// + /// Discriminated union value + /// + public object? Value { get; internal set; } + + /// + /// Returns true if is "objectNumber" + /// + public bool IsObjectNumber => Kind == "objectNumber"; + + /// + /// Returns true if is "fqn" + /// + public bool IsFqn => Kind == "fqn"; + + /// + /// Returns the value as a if is 'objectNumber', otherwise throws an exception. + /// + /// Thrown when is not 'objectNumber'. + public CloudPDF.DocSignaturesComplete200ResponseSignatureFieldObjectNumber AsObjectNumber() => + IsObjectNumber + ? (CloudPDF.DocSignaturesComplete200ResponseSignatureFieldObjectNumber)Value! + : throw new global::System.Exception( + "DocSignaturesComplete200ResponseSignatureField.Kind is not 'objectNumber'" + ); + + /// + /// Returns the value as a if is 'fqn', otherwise throws an exception. + /// + /// Thrown when is not 'fqn'. + public CloudPDF.DocSignaturesComplete200ResponseSignatureFieldFqn AsFqn() => + IsFqn + ? (CloudPDF.DocSignaturesComplete200ResponseSignatureFieldFqn)Value! + : throw new global::System.Exception( + "DocSignaturesComplete200ResponseSignatureField.Kind is not 'fqn'" + ); + + public T Match( + Func onObjectNumber, + Func onFqn, + Func onUnknown_ + ) + { + return Kind switch + { + "objectNumber" => onObjectNumber(AsObjectNumber()), + "fqn" => onFqn(AsFqn()), + _ => onUnknown_(Kind, Value), + }; + } + + public void Visit( + Action onObjectNumber, + Action onFqn, + Action onUnknown_ + ) + { + switch (Kind) + { + case "objectNumber": + onObjectNumber(AsObjectNumber()); + break; + case "fqn": + onFqn(AsFqn()); + break; + default: + onUnknown_(Kind, Value); + break; + } + } + + /// + /// Attempts to cast the value to a and returns true if successful. + /// + public bool TryAsObjectNumber( + out CloudPDF.DocSignaturesComplete200ResponseSignatureFieldObjectNumber? value + ) + { + if (Kind == "objectNumber") + { + value = (CloudPDF.DocSignaturesComplete200ResponseSignatureFieldObjectNumber)Value!; + return true; + } + value = null; + return false; + } + + /// + /// Attempts to cast the value to a and returns true if successful. + /// + public bool TryAsFqn(out CloudPDF.DocSignaturesComplete200ResponseSignatureFieldFqn? value) + { + if (Kind == "fqn") + { + value = (CloudPDF.DocSignaturesComplete200ResponseSignatureFieldFqn)Value!; + return true; + } + value = null; + return false; + } + + public override string ToString() => JsonUtils.Serialize(this); + + public static implicit operator DocSignaturesComplete200ResponseSignatureField( + DocSignaturesComplete200ResponseSignatureField.ObjectNumber value + ) => new(value); + + public static implicit operator DocSignaturesComplete200ResponseSignatureField( + DocSignaturesComplete200ResponseSignatureField.Fqn value + ) => new(value); + + [Serializable] + internal sealed class JsonConverter + : JsonConverter + { + public override bool CanConvert(global::System.Type typeToConvert) => + typeof(DocSignaturesComplete200ResponseSignatureField).IsAssignableFrom(typeToConvert); + + public override DocSignaturesComplete200ResponseSignatureField Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var json = JsonElement.ParseValue(ref reader); + if (!json.TryGetProperty("kind", out var discriminatorElement)) + { + throw new JsonException("Missing discriminator property 'kind'"); + } + if (discriminatorElement.ValueKind != JsonValueKind.String) + { + if (discriminatorElement.ValueKind == JsonValueKind.Null) + { + throw new JsonException("Discriminator property 'kind' is null"); + } + + throw new JsonException( + $"Discriminator property 'kind' is not a string, instead is {discriminatorElement.ToString()}" + ); + } + + var discriminator = + discriminatorElement.GetString() + ?? throw new JsonException("Discriminator property 'kind' is null"); + + // Strip the discriminant property to prevent it from leaking into AdditionalProperties + var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); + jsonObject?.Remove("kind"); + var jsonWithoutDiscriminator = + jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; + + var value = discriminator switch + { + "objectNumber" => + jsonWithoutDiscriminator.Deserialize( + options + ) + ?? throw new JsonException( + "Failed to deserialize CloudPDF.DocSignaturesComplete200ResponseSignatureFieldObjectNumber" + ), + "fqn" => + jsonWithoutDiscriminator.Deserialize( + options + ) + ?? throw new JsonException( + "Failed to deserialize CloudPDF.DocSignaturesComplete200ResponseSignatureFieldFqn" + ), + _ => json.Deserialize(options), + }; + return new DocSignaturesComplete200ResponseSignatureField(discriminator, value); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseSignatureField value, + JsonSerializerOptions options + ) + { + JsonNode json = + value.Kind switch + { + "objectNumber" => JsonSerializer.SerializeToNode(value.Value, options), + "fqn" => JsonSerializer.SerializeToNode(value.Value, options), + _ => JsonSerializer.SerializeToNode(value.Value, options), + } ?? new JsonObject(); + json["kind"] = value.Kind; + json.WriteTo(writer, options); + } + + public override DocSignaturesComplete200ResponseSignatureField ReadAsPropertyName( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new JsonException("The JSON property name could not be read as a string."); + return new DocSignaturesComplete200ResponseSignatureField(stringValue, stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseSignatureField value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Kind); + } + } + + /// + /// Discriminated union type for objectNumber + /// + [Serializable] + public struct ObjectNumber + { + public ObjectNumber( + CloudPDF.DocSignaturesComplete200ResponseSignatureFieldObjectNumber value + ) + { + Value = value; + } + + internal CloudPDF.DocSignaturesComplete200ResponseSignatureFieldObjectNumber Value { get; set; } + + public override string ToString() => Value.ToString() ?? "null"; + + public static implicit operator DocSignaturesComplete200ResponseSignatureField.ObjectNumber( + CloudPDF.DocSignaturesComplete200ResponseSignatureFieldObjectNumber value + ) => new(value); + } + + /// + /// Discriminated union type for fqn + /// + [Serializable] + public struct Fqn + { + public Fqn(CloudPDF.DocSignaturesComplete200ResponseSignatureFieldFqn value) + { + Value = value; + } + + internal CloudPDF.DocSignaturesComplete200ResponseSignatureFieldFqn Value { get; set; } + + public override string ToString() => Value.ToString() ?? "null"; + + public static implicit operator DocSignaturesComplete200ResponseSignatureField.Fqn( + CloudPDF.DocSignaturesComplete200ResponseSignatureFieldFqn value + ) => new(value); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldFqn.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldFqn.cs new file mode 100644 index 0000000..94a1244 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldFqn.cs @@ -0,0 +1,28 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseSignatureFieldFqn : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required string Name { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldMdp.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldMdp.cs new file mode 100644 index 0000000..6c14f1d --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldMdp.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseSignatureFieldMdp : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("action")] + public required DocSignaturesComplete200ResponseSignatureFieldMdpAction Action { get; set; } + + [JsonPropertyName("fields")] + public IEnumerable Fields { get; set; } = new List(); + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldMdpAction.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldMdpAction.cs new file mode 100644 index 0000000..2942ea1 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldMdpAction.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete200ResponseSignatureFieldMdpAction.DocSignaturesComplete200ResponseSignatureFieldMdpActionSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete200ResponseSignatureFieldMdpAction : IStringEnum +{ + public static readonly DocSignaturesComplete200ResponseSignatureFieldMdpAction All = new( + Values.All + ); + + public static readonly DocSignaturesComplete200ResponseSignatureFieldMdpAction Include = new( + Values.Include + ); + + public static readonly DocSignaturesComplete200ResponseSignatureFieldMdpAction Exclude = new( + Values.Exclude + ); + + public DocSignaturesComplete200ResponseSignatureFieldMdpAction(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete200ResponseSignatureFieldMdpAction FromCustom(string value) + { + return new DocSignaturesComplete200ResponseSignatureFieldMdpAction(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesComplete200ResponseSignatureFieldMdpAction value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesComplete200ResponseSignatureFieldMdpAction value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesComplete200ResponseSignatureFieldMdpAction value + ) => value.Value; + + public static explicit operator DocSignaturesComplete200ResponseSignatureFieldMdpAction( + string value + ) => new(value); + + internal class DocSignaturesComplete200ResponseSignatureFieldMdpActionSerializer + : JsonConverter + { + public override DocSignaturesComplete200ResponseSignatureFieldMdpAction Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete200ResponseSignatureFieldMdpAction(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseSignatureFieldMdpAction value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete200ResponseSignatureFieldMdpAction ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete200ResponseSignatureFieldMdpAction(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseSignatureFieldMdpAction value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string All = "all"; + + public const string Include = "include"; + + public const string Exclude = "exclude"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldObjectNumber.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldObjectNumber.cs new file mode 100644 index 0000000..595ae9a --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureFieldObjectNumber.cs @@ -0,0 +1,28 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseSignatureFieldObjectNumber : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("fieldObjectNumber")] + public required int FieldObjectNumber { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureKind.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureKind.cs new file mode 100644 index 0000000..cf5538f --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureKind.cs @@ -0,0 +1,128 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete200ResponseSignatureKind.DocSignaturesComplete200ResponseSignatureKindSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete200ResponseSignatureKind : IStringEnum +{ + public static readonly DocSignaturesComplete200ResponseSignatureKind Signature = new( + Values.Signature + ); + + public static readonly DocSignaturesComplete200ResponseSignatureKind Timestamp = new( + Values.Timestamp + ); + + public DocSignaturesComplete200ResponseSignatureKind(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete200ResponseSignatureKind FromCustom(string value) + { + return new DocSignaturesComplete200ResponseSignatureKind(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesComplete200ResponseSignatureKind value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesComplete200ResponseSignatureKind value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesComplete200ResponseSignatureKind value) => + value.Value; + + public static explicit operator DocSignaturesComplete200ResponseSignatureKind(string value) => + new(value); + + internal class DocSignaturesComplete200ResponseSignatureKindSerializer + : JsonConverter + { + public override DocSignaturesComplete200ResponseSignatureKind Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete200ResponseSignatureKind(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseSignatureKind value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete200ResponseSignatureKind ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete200ResponseSignatureKind(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseSignatureKind value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Signature = "signature"; + + public const string Timestamp = "timestamp"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureLock.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureLock.cs new file mode 100644 index 0000000..1a36324 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureLock.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseSignatureLock : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("action")] + public required DocSignaturesComplete200ResponseSignatureLockAction Action { get; set; } + + [JsonPropertyName("fields")] + public IEnumerable Fields { get; set; } = new List(); + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureLockAction.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureLockAction.cs new file mode 100644 index 0000000..0f1c880 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureLockAction.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete200ResponseSignatureLockAction.DocSignaturesComplete200ResponseSignatureLockActionSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete200ResponseSignatureLockAction : IStringEnum +{ + public static readonly DocSignaturesComplete200ResponseSignatureLockAction All = new( + Values.All + ); + + public static readonly DocSignaturesComplete200ResponseSignatureLockAction Include = new( + Values.Include + ); + + public static readonly DocSignaturesComplete200ResponseSignatureLockAction Exclude = new( + Values.Exclude + ); + + public DocSignaturesComplete200ResponseSignatureLockAction(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete200ResponseSignatureLockAction FromCustom(string value) + { + return new DocSignaturesComplete200ResponseSignatureLockAction(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesComplete200ResponseSignatureLockAction value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesComplete200ResponseSignatureLockAction value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesComplete200ResponseSignatureLockAction value + ) => value.Value; + + public static explicit operator DocSignaturesComplete200ResponseSignatureLockAction( + string value + ) => new(value); + + internal class DocSignaturesComplete200ResponseSignatureLockActionSerializer + : JsonConverter + { + public override DocSignaturesComplete200ResponseSignatureLockAction Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete200ResponseSignatureLockAction(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseSignatureLockAction value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete200ResponseSignatureLockAction ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete200ResponseSignatureLockAction(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseSignatureLockAction value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string All = "all"; + + public const string Include = "include"; + + public const string Exclude = "exclude"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureSeedValue.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureSeedValue.cs new file mode 100644 index 0000000..2815ded --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureSeedValue.cs @@ -0,0 +1,52 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseSignatureSeedValue : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("requiredFlags")] + public required int RequiredFlags { get; set; } + + [JsonPropertyName("presentFlags")] + public required int PresentFlags { get; set; } + + [JsonPropertyName("version")] + public int? Version { get; set; } + + [JsonPropertyName("mdp")] + public double? Mdp { get; set; } + + [JsonPropertyName("filter")] + public string? Filter { get; set; } + + [JsonPropertyName("subFilters")] + public IEnumerable SubFilters { get; set; } = new List(); + + [JsonPropertyName("digestMethods")] + public IEnumerable DigestMethods { get; set; } = new List(); + + [JsonPropertyName("reasons")] + public IEnumerable Reasons { get; set; } = new List(); + + [JsonPropertyName("unsupportedRequired")] + public required bool UnsupportedRequired { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureSigner.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureSigner.cs new file mode 100644 index 0000000..0ef9e50 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureSigner.cs @@ -0,0 +1,40 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseSignatureSigner : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonPropertyName("reason")] + public string? Reason { get; set; } + + [JsonPropertyName("location")] + public string? Location { get; set; } + + [JsonPropertyName("contactInfo")] + public string? ContactInfo { get; set; } + + [JsonPropertyName("claimedTime")] + public string? ClaimedTime { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureWidget.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureWidget.cs new file mode 100644 index 0000000..0d82765 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseSignatureWidget.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseSignatureWidget : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("annotObjectNumber")] + public required int AnnotObjectNumber { get; set; } + + [JsonPropertyName("pageObjectNumber")] + public required int PageObjectNumber { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseStatus.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseStatus.cs new file mode 100644 index 0000000..d0b3e0b --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseStatus.cs @@ -0,0 +1,122 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete200ResponseStatus.DocSignaturesComplete200ResponseStatusSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete200ResponseStatus : IStringEnum +{ + public static readonly DocSignaturesComplete200ResponseStatus Completed = new(Values.Completed); + + public static readonly DocSignaturesComplete200ResponseStatus AlreadyCompleted = new( + Values.AlreadyCompleted + ); + + public DocSignaturesComplete200ResponseStatus(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete200ResponseStatus FromCustom(string value) + { + return new DocSignaturesComplete200ResponseStatus(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesComplete200ResponseStatus value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesComplete200ResponseStatus value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesComplete200ResponseStatus value) => + value.Value; + + public static explicit operator DocSignaturesComplete200ResponseStatus(string value) => + new(value); + + internal class DocSignaturesComplete200ResponseStatusSerializer + : JsonConverter + { + public override DocSignaturesComplete200ResponseStatus Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete200ResponseStatus(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseStatus value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete200ResponseStatus ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete200ResponseStatus(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete200ResponseStatus value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Completed = "completed"; + + public const string AlreadyCompleted = "already-completed"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete200ResponseVersion.cs b/src/CloudPDF/Types/DocSignaturesComplete200ResponseVersion.cs new file mode 100644 index 0000000..6b72410 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete200ResponseVersion.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete200ResponseVersion : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("sha256")] + public required string Sha256 { get; set; } + + [JsonPropertyName("byteLength")] + public required int ByteLength { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete400Response.cs b/src/CloudPDF/Types/DocSignaturesComplete400Response.cs new file mode 100644 index 0000000..906b324 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete400Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete400Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocSignaturesComplete400ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocSignaturesComplete400ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete400ResponseCode.cs b/src/CloudPDF/Types/DocSignaturesComplete400ResponseCode.cs new file mode 100644 index 0000000..edc5aba --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete400ResponseCode.cs @@ -0,0 +1,244 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete400ResponseCode.DocSignaturesComplete400ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete400ResponseCode : IStringEnum +{ + public static readonly DocSignaturesComplete400ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocSignaturesComplete400ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocSignaturesComplete400ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocSignaturesComplete400ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocSignaturesComplete400ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocSignaturesComplete400ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocSignaturesComplete400ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocSignaturesComplete400ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocSignaturesComplete400ResponseCode Network = new(Values.Network); + + public static readonly DocSignaturesComplete400ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocSignaturesComplete400ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocSignaturesComplete400ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocSignaturesComplete400ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocSignaturesComplete400ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocSignaturesComplete400ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocSignaturesComplete400ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocSignaturesComplete400ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocSignaturesComplete400ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocSignaturesComplete400ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocSignaturesComplete400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocSignaturesComplete400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocSignaturesComplete400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocSignaturesComplete400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocSignaturesComplete400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocSignaturesComplete400ResponseCode StaleBase = new(Values.StaleBase); + + public DocSignaturesComplete400ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete400ResponseCode FromCustom(string value) + { + return new DocSignaturesComplete400ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesComplete400ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesComplete400ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesComplete400ResponseCode value) => + value.Value; + + public static explicit operator DocSignaturesComplete400ResponseCode(string value) => + new(value); + + internal class DocSignaturesComplete400ResponseCodeSerializer + : JsonConverter + { + public override DocSignaturesComplete400ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete400ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete400ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete400ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete400ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete400ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete400ResponseName.cs b/src/CloudPDF/Types/DocSignaturesComplete400ResponseName.cs new file mode 100644 index 0000000..1efaa40 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete400ResponseName.cs @@ -0,0 +1,118 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete400ResponseName.DocSignaturesComplete400ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete400ResponseName : IStringEnum +{ + public static readonly DocSignaturesComplete400ResponseName EngineError = new( + Values.EngineError + ); + + public DocSignaturesComplete400ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete400ResponseName FromCustom(string value) + { + return new DocSignaturesComplete400ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesComplete400ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesComplete400ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesComplete400ResponseName value) => + value.Value; + + public static explicit operator DocSignaturesComplete400ResponseName(string value) => + new(value); + + internal class DocSignaturesComplete400ResponseNameSerializer + : JsonConverter + { + public override DocSignaturesComplete400ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete400ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete400ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete400ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete400ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete400ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete404Response.cs b/src/CloudPDF/Types/DocSignaturesComplete404Response.cs new file mode 100644 index 0000000..413167c --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete404Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete404Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocSignaturesComplete404ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocSignaturesComplete404ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete404ResponseCode.cs b/src/CloudPDF/Types/DocSignaturesComplete404ResponseCode.cs new file mode 100644 index 0000000..a4e9692 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete404ResponseCode.cs @@ -0,0 +1,244 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete404ResponseCode.DocSignaturesComplete404ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete404ResponseCode : IStringEnum +{ + public static readonly DocSignaturesComplete404ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocSignaturesComplete404ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocSignaturesComplete404ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocSignaturesComplete404ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocSignaturesComplete404ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocSignaturesComplete404ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocSignaturesComplete404ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocSignaturesComplete404ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocSignaturesComplete404ResponseCode Network = new(Values.Network); + + public static readonly DocSignaturesComplete404ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocSignaturesComplete404ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocSignaturesComplete404ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocSignaturesComplete404ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocSignaturesComplete404ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocSignaturesComplete404ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocSignaturesComplete404ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocSignaturesComplete404ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocSignaturesComplete404ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocSignaturesComplete404ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocSignaturesComplete404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocSignaturesComplete404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocSignaturesComplete404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocSignaturesComplete404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocSignaturesComplete404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocSignaturesComplete404ResponseCode StaleBase = new(Values.StaleBase); + + public DocSignaturesComplete404ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete404ResponseCode FromCustom(string value) + { + return new DocSignaturesComplete404ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesComplete404ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesComplete404ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesComplete404ResponseCode value) => + value.Value; + + public static explicit operator DocSignaturesComplete404ResponseCode(string value) => + new(value); + + internal class DocSignaturesComplete404ResponseCodeSerializer + : JsonConverter + { + public override DocSignaturesComplete404ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete404ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete404ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete404ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete404ResponseName.cs b/src/CloudPDF/Types/DocSignaturesComplete404ResponseName.cs new file mode 100644 index 0000000..737b164 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete404ResponseName.cs @@ -0,0 +1,118 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete404ResponseName.DocSignaturesComplete404ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete404ResponseName : IStringEnum +{ + public static readonly DocSignaturesComplete404ResponseName EngineError = new( + Values.EngineError + ); + + public DocSignaturesComplete404ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete404ResponseName FromCustom(string value) + { + return new DocSignaturesComplete404ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesComplete404ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesComplete404ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesComplete404ResponseName value) => + value.Value; + + public static explicit operator DocSignaturesComplete404ResponseName(string value) => + new(value); + + internal class DocSignaturesComplete404ResponseNameSerializer + : JsonConverter + { + public override DocSignaturesComplete404ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete404ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete404ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete404ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete409Response.cs b/src/CloudPDF/Types/DocSignaturesComplete409Response.cs new file mode 100644 index 0000000..0c44a90 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete409Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesComplete409Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocSignaturesComplete409ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocSignaturesComplete409ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete409ResponseCode.cs b/src/CloudPDF/Types/DocSignaturesComplete409ResponseCode.cs new file mode 100644 index 0000000..3c38029 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete409ResponseCode.cs @@ -0,0 +1,244 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete409ResponseCode.DocSignaturesComplete409ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete409ResponseCode : IStringEnum +{ + public static readonly DocSignaturesComplete409ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocSignaturesComplete409ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocSignaturesComplete409ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocSignaturesComplete409ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocSignaturesComplete409ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocSignaturesComplete409ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocSignaturesComplete409ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocSignaturesComplete409ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocSignaturesComplete409ResponseCode Network = new(Values.Network); + + public static readonly DocSignaturesComplete409ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocSignaturesComplete409ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocSignaturesComplete409ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocSignaturesComplete409ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocSignaturesComplete409ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocSignaturesComplete409ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocSignaturesComplete409ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocSignaturesComplete409ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocSignaturesComplete409ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocSignaturesComplete409ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocSignaturesComplete409ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocSignaturesComplete409ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocSignaturesComplete409ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocSignaturesComplete409ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocSignaturesComplete409ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocSignaturesComplete409ResponseCode StaleBase = new(Values.StaleBase); + + public DocSignaturesComplete409ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete409ResponseCode FromCustom(string value) + { + return new DocSignaturesComplete409ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesComplete409ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesComplete409ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesComplete409ResponseCode value) => + value.Value; + + public static explicit operator DocSignaturesComplete409ResponseCode(string value) => + new(value); + + internal class DocSignaturesComplete409ResponseCodeSerializer + : JsonConverter + { + public override DocSignaturesComplete409ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete409ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete409ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete409ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete409ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete409ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesComplete409ResponseName.cs b/src/CloudPDF/Types/DocSignaturesComplete409ResponseName.cs new file mode 100644 index 0000000..18c99a4 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesComplete409ResponseName.cs @@ -0,0 +1,118 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesComplete409ResponseName.DocSignaturesComplete409ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesComplete409ResponseName : IStringEnum +{ + public static readonly DocSignaturesComplete409ResponseName EngineError = new( + Values.EngineError + ); + + public DocSignaturesComplete409ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesComplete409ResponseName FromCustom(string value) + { + return new DocSignaturesComplete409ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesComplete409ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesComplete409ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesComplete409ResponseName value) => + value.Value; + + public static explicit operator DocSignaturesComplete409ResponseName(string value) => + new(value); + + internal class DocSignaturesComplete409ResponseNameSerializer + : JsonConverter + { + public override DocSignaturesComplete409ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesComplete409ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesComplete409ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesComplete409ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesComplete409ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesComplete409ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200Response.cs b/src/CloudPDF/Types/DocSignaturesList200Response.cs new file mode 100644 index 0000000..4c64708 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200Response.cs @@ -0,0 +1,39 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("chainValid")] + public required bool ChainValid { get; set; } + + [JsonPropertyName("revisions")] + public IEnumerable Revisions { get; set; } = + new List(); + + [JsonPropertyName("signatures")] + public IEnumerable Signatures { get; set; } = + new List(); + + [JsonPropertyName("protection")] + public required DocSignaturesList200ResponseProtection Protection { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseProtection.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseProtection.cs new file mode 100644 index 0000000..171030e --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseProtection.cs @@ -0,0 +1,41 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseProtection : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("enforced")] + public DocSignaturesList200ResponseProtectionEnforced? Enforced { get; set; } + + [JsonPropertyName("judged")] + public DocSignaturesList200ResponseProtectionJudged? Judged { get; set; } + + [JsonPropertyName("certification")] + public DocSignaturesList200ResponseProtectionCertification? Certification { get; set; } + + [JsonPropertyName("fieldLocks")] + public IEnumerable FieldLocks { get; set; } = + new List(); + + [JsonPropertyName("policyVersion")] + public required int PolicyVersion { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionCertification.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionCertification.cs new file mode 100644 index 0000000..86a26b6 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionCertification.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseProtectionCertification : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("signatureIndex")] + public required int SignatureIndex { get; set; } + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionEnforced.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionEnforced.cs new file mode 100644 index 0000000..29d901d --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionEnforced.cs @@ -0,0 +1,134 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesList200ResponseProtectionEnforced.DocSignaturesList200ResponseProtectionEnforcedSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesList200ResponseProtectionEnforced : IStringEnum +{ + public static readonly DocSignaturesList200ResponseProtectionEnforced None = new(Values.None); + + public static readonly DocSignaturesList200ResponseProtectionEnforced Lta = new(Values.Lta); + + public static readonly DocSignaturesList200ResponseProtectionEnforced Fill = new(Values.Fill); + + public static readonly DocSignaturesList200ResponseProtectionEnforced Annotate = new( + Values.Annotate + ); + + public DocSignaturesList200ResponseProtectionEnforced(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesList200ResponseProtectionEnforced FromCustom(string value) + { + return new DocSignaturesList200ResponseProtectionEnforced(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesList200ResponseProtectionEnforced value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesList200ResponseProtectionEnforced value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesList200ResponseProtectionEnforced value) => + value.Value; + + public static explicit operator DocSignaturesList200ResponseProtectionEnforced(string value) => + new(value); + + internal class DocSignaturesList200ResponseProtectionEnforcedSerializer + : JsonConverter + { + public override DocSignaturesList200ResponseProtectionEnforced Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesList200ResponseProtectionEnforced(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesList200ResponseProtectionEnforced value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesList200ResponseProtectionEnforced ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesList200ResponseProtectionEnforced(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesList200ResponseProtectionEnforced value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string None = "none"; + + public const string Lta = "lta"; + + public const string Fill = "fill"; + + public const string Annotate = "annotate"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItem.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItem.cs new file mode 100644 index 0000000..81bef9f --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItem.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseProtectionFieldLocksItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("signatureIndex")] + public required int SignatureIndex { get; set; } + + [JsonPropertyName("source")] + public required DocSignaturesList200ResponseProtectionFieldLocksItemSource Source { get; set; } + + [JsonPropertyName("spec")] + public DocSignaturesList200ResponseProtectionFieldLocksItemSpec? Spec { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSource.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSource.cs new file mode 100644 index 0000000..92e6fb6 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSource.cs @@ -0,0 +1,132 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesList200ResponseProtectionFieldLocksItemSource.DocSignaturesList200ResponseProtectionFieldLocksItemSourceSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesList200ResponseProtectionFieldLocksItemSource + : IStringEnum +{ + public static readonly DocSignaturesList200ResponseProtectionFieldLocksItemSource Fieldmdp = + new(Values.Fieldmdp); + + public static readonly DocSignaturesList200ResponseProtectionFieldLocksItemSource Lock = new( + Values.Lock + ); + + public DocSignaturesList200ResponseProtectionFieldLocksItemSource(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesList200ResponseProtectionFieldLocksItemSource FromCustom( + string value + ) + { + return new DocSignaturesList200ResponseProtectionFieldLocksItemSource(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesList200ResponseProtectionFieldLocksItemSource value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesList200ResponseProtectionFieldLocksItemSource value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesList200ResponseProtectionFieldLocksItemSource value + ) => value.Value; + + public static explicit operator DocSignaturesList200ResponseProtectionFieldLocksItemSource( + string value + ) => new(value); + + internal class DocSignaturesList200ResponseProtectionFieldLocksItemSourceSerializer + : JsonConverter + { + public override DocSignaturesList200ResponseProtectionFieldLocksItemSource Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesList200ResponseProtectionFieldLocksItemSource(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesList200ResponseProtectionFieldLocksItemSource value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesList200ResponseProtectionFieldLocksItemSource ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesList200ResponseProtectionFieldLocksItemSource(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesList200ResponseProtectionFieldLocksItemSource value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Fieldmdp = "fieldmdp"; + + public const string Lock = "lock"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSpec.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSpec.cs new file mode 100644 index 0000000..5375664 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSpec.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseProtectionFieldLocksItemSpec : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("action")] + public required DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction Action { get; set; } + + [JsonPropertyName("fields")] + public IEnumerable Fields { get; set; } = new List(); + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction.cs new file mode 100644 index 0000000..9831ba1 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction.cs @@ -0,0 +1,137 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction.DocSignaturesList200ResponseProtectionFieldLocksItemSpecActionSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction + : IStringEnum +{ + public static readonly DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction All = new( + Values.All + ); + + public static readonly DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction Include = + new(Values.Include); + + public static readonly DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction Exclude = + new(Values.Exclude); + + public DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction FromCustom( + string value + ) + { + return new DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction value + ) => value.Value; + + public static explicit operator DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction( + string value + ) => new(value); + + internal class DocSignaturesList200ResponseProtectionFieldLocksItemSpecActionSerializer + : JsonConverter + { + public override DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string All = "all"; + + public const string Include = "include"; + + public const string Exclude = "exclude"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionJudged.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionJudged.cs new file mode 100644 index 0000000..caefe35 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseProtectionJudged.cs @@ -0,0 +1,134 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesList200ResponseProtectionJudged.DocSignaturesList200ResponseProtectionJudgedSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesList200ResponseProtectionJudged : IStringEnum +{ + public static readonly DocSignaturesList200ResponseProtectionJudged None = new(Values.None); + + public static readonly DocSignaturesList200ResponseProtectionJudged Lta = new(Values.Lta); + + public static readonly DocSignaturesList200ResponseProtectionJudged Fill = new(Values.Fill); + + public static readonly DocSignaturesList200ResponseProtectionJudged Annotate = new( + Values.Annotate + ); + + public DocSignaturesList200ResponseProtectionJudged(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesList200ResponseProtectionJudged FromCustom(string value) + { + return new DocSignaturesList200ResponseProtectionJudged(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesList200ResponseProtectionJudged value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesList200ResponseProtectionJudged value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesList200ResponseProtectionJudged value) => + value.Value; + + public static explicit operator DocSignaturesList200ResponseProtectionJudged(string value) => + new(value); + + internal class DocSignaturesList200ResponseProtectionJudgedSerializer + : JsonConverter + { + public override DocSignaturesList200ResponseProtectionJudged Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesList200ResponseProtectionJudged(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesList200ResponseProtectionJudged value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesList200ResponseProtectionJudged ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesList200ResponseProtectionJudged(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesList200ResponseProtectionJudged value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string None = "none"; + + public const string Lta = "lta"; + + public const string Fill = "fill"; + + public const string Annotate = "annotate"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseRevisionsItem.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseRevisionsItem.cs new file mode 100644 index 0000000..d9329c8 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseRevisionsItem.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseRevisionsItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("index")] + public required int Index { get; set; } + + [JsonPropertyName("end")] + public required int End { get; set; } + + [JsonPropertyName("xrefOffset")] + public required int XrefOffset { get; set; } + + [JsonPropertyName("signatureIndex")] + public int? SignatureIndex { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItem.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItem.cs new file mode 100644 index 0000000..db86f1e --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItem.cs @@ -0,0 +1,79 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseSignaturesItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("index")] + public required int Index { get; set; } + + [JsonPropertyName("field")] + public required DocSignaturesList200ResponseSignaturesItemField Field { get; set; } + + [JsonPropertyName("fieldName")] + public required string FieldName { get; set; } + + [JsonPropertyName("widget")] + public DocSignaturesList200ResponseSignaturesItemWidget? Widget { get; set; } + + [JsonPropertyName("signed")] + public required bool Signed { get; set; } + + [JsonPropertyName("kind")] + public required DocSignaturesList200ResponseSignaturesItemKind Kind { get; set; } + + [JsonPropertyName("filter")] + public string? Filter { get; set; } + + [JsonPropertyName("subFilter")] + public string? SubFilter { get; set; } + + [JsonPropertyName("byteRange")] + public IEnumerable? ByteRange { get; set; } + + [JsonPropertyName("contentsSize")] + public required int ContentsSize { get; set; } + + [JsonPropertyName("coverage")] + public DocSignaturesList200ResponseSignaturesItemCoverage? Coverage { get; set; } + + [JsonPropertyName("revisionIndex")] + public int? RevisionIndex { get; set; } + + [JsonPropertyName("signer")] + public required DocSignaturesList200ResponseSignaturesItemSigner Signer { get; set; } + + [JsonPropertyName("docMdp")] + public double? DocMdp { get; set; } + + [JsonPropertyName("catalogCertification")] + public required bool CatalogCertification { get; set; } + + [JsonPropertyName("fieldMdp")] + public DocSignaturesList200ResponseSignaturesItemFieldMdp? FieldMdp { get; set; } + + [JsonPropertyName("lock")] + public DocSignaturesList200ResponseSignaturesItemLock? Lock { get; set; } + + [JsonPropertyName("seedValue")] + public DocSignaturesList200ResponseSignaturesItemSeedValue? SeedValue { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemCoverage.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemCoverage.cs new file mode 100644 index 0000000..59b1d84 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemCoverage.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesList200ResponseSignaturesItemCoverage.DocSignaturesList200ResponseSignaturesItemCoverageSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesList200ResponseSignaturesItemCoverage : IStringEnum +{ + public static readonly DocSignaturesList200ResponseSignaturesItemCoverage WholeRevision = new( + Values.WholeRevision + ); + + public static readonly DocSignaturesList200ResponseSignaturesItemCoverage Partial = new( + Values.Partial + ); + + public static readonly DocSignaturesList200ResponseSignaturesItemCoverage Malformed = new( + Values.Malformed + ); + + public DocSignaturesList200ResponseSignaturesItemCoverage(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesList200ResponseSignaturesItemCoverage FromCustom(string value) + { + return new DocSignaturesList200ResponseSignaturesItemCoverage(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesList200ResponseSignaturesItemCoverage value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesList200ResponseSignaturesItemCoverage value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesList200ResponseSignaturesItemCoverage value + ) => value.Value; + + public static explicit operator DocSignaturesList200ResponseSignaturesItemCoverage( + string value + ) => new(value); + + internal class DocSignaturesList200ResponseSignaturesItemCoverageSerializer + : JsonConverter + { + public override DocSignaturesList200ResponseSignaturesItemCoverage Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesList200ResponseSignaturesItemCoverage(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesList200ResponseSignaturesItemCoverage value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesList200ResponseSignaturesItemCoverage ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesList200ResponseSignaturesItemCoverage(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesList200ResponseSignaturesItemCoverage value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string WholeRevision = "whole-revision"; + + public const string Partial = "partial"; + + public const string Malformed = "malformed"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemField.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemField.cs new file mode 100644 index 0000000..53dd7dd --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemField.cs @@ -0,0 +1,304 @@ +// ReSharper disable NullableWarningSuppressionIsUsed +// ReSharper disable InconsistentNaming + +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Nodes; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter(typeof(DocSignaturesList200ResponseSignaturesItemField.JsonConverter))] +[Serializable] +public record DocSignaturesList200ResponseSignaturesItemField +{ + internal DocSignaturesList200ResponseSignaturesItemField(string type, object? value) + { + Kind = type; + Value = value; + } + + /// + /// Create an instance of DocSignaturesList200ResponseSignaturesItemField with . + /// + public DocSignaturesList200ResponseSignaturesItemField( + DocSignaturesList200ResponseSignaturesItemField.ObjectNumber value + ) + { + Kind = "objectNumber"; + Value = value.Value; + } + + /// + /// Create an instance of DocSignaturesList200ResponseSignaturesItemField with . + /// + public DocSignaturesList200ResponseSignaturesItemField( + DocSignaturesList200ResponseSignaturesItemField.Fqn value + ) + { + Kind = "fqn"; + Value = value.Value; + } + + /// + /// Discriminant value + /// + [JsonPropertyName("kind")] + public string Kind { get; internal set; } + + /// + /// Discriminated union value + /// + public object? Value { get; internal set; } + + /// + /// Returns true if is "objectNumber" + /// + public bool IsObjectNumber => Kind == "objectNumber"; + + /// + /// Returns true if is "fqn" + /// + public bool IsFqn => Kind == "fqn"; + + /// + /// Returns the value as a if is 'objectNumber', otherwise throws an exception. + /// + /// Thrown when is not 'objectNumber'. + public CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldObjectNumber AsObjectNumber() => + IsObjectNumber + ? (CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldObjectNumber)Value! + : throw new global::System.Exception( + "DocSignaturesList200ResponseSignaturesItemField.Kind is not 'objectNumber'" + ); + + /// + /// Returns the value as a if is 'fqn', otherwise throws an exception. + /// + /// Thrown when is not 'fqn'. + public CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldFqn AsFqn() => + IsFqn + ? (CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldFqn)Value! + : throw new global::System.Exception( + "DocSignaturesList200ResponseSignaturesItemField.Kind is not 'fqn'" + ); + + public T Match( + Func< + CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldObjectNumber, + T + > onObjectNumber, + Func onFqn, + Func onUnknown_ + ) + { + return Kind switch + { + "objectNumber" => onObjectNumber(AsObjectNumber()), + "fqn" => onFqn(AsFqn()), + _ => onUnknown_(Kind, Value), + }; + } + + public void Visit( + Action onObjectNumber, + Action onFqn, + Action onUnknown_ + ) + { + switch (Kind) + { + case "objectNumber": + onObjectNumber(AsObjectNumber()); + break; + case "fqn": + onFqn(AsFqn()); + break; + default: + onUnknown_(Kind, Value); + break; + } + } + + /// + /// Attempts to cast the value to a and returns true if successful. + /// + public bool TryAsObjectNumber( + out CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldObjectNumber? value + ) + { + if (Kind == "objectNumber") + { + value = (CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldObjectNumber)Value!; + return true; + } + value = null; + return false; + } + + /// + /// Attempts to cast the value to a and returns true if successful. + /// + public bool TryAsFqn(out CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldFqn? value) + { + if (Kind == "fqn") + { + value = (CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldFqn)Value!; + return true; + } + value = null; + return false; + } + + public override string ToString() => JsonUtils.Serialize(this); + + public static implicit operator DocSignaturesList200ResponseSignaturesItemField( + DocSignaturesList200ResponseSignaturesItemField.ObjectNumber value + ) => new(value); + + public static implicit operator DocSignaturesList200ResponseSignaturesItemField( + DocSignaturesList200ResponseSignaturesItemField.Fqn value + ) => new(value); + + [Serializable] + internal sealed class JsonConverter + : JsonConverter + { + public override bool CanConvert(global::System.Type typeToConvert) => + typeof(DocSignaturesList200ResponseSignaturesItemField).IsAssignableFrom(typeToConvert); + + public override DocSignaturesList200ResponseSignaturesItemField Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var json = JsonElement.ParseValue(ref reader); + if (!json.TryGetProperty("kind", out var discriminatorElement)) + { + throw new JsonException("Missing discriminator property 'kind'"); + } + if (discriminatorElement.ValueKind != JsonValueKind.String) + { + if (discriminatorElement.ValueKind == JsonValueKind.Null) + { + throw new JsonException("Discriminator property 'kind' is null"); + } + + throw new JsonException( + $"Discriminator property 'kind' is not a string, instead is {discriminatorElement.ToString()}" + ); + } + + var discriminator = + discriminatorElement.GetString() + ?? throw new JsonException("Discriminator property 'kind' is null"); + + // Strip the discriminant property to prevent it from leaking into AdditionalProperties + var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); + jsonObject?.Remove("kind"); + var jsonWithoutDiscriminator = + jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; + + var value = discriminator switch + { + "objectNumber" => + jsonWithoutDiscriminator.Deserialize( + options + ) + ?? throw new JsonException( + "Failed to deserialize CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldObjectNumber" + ), + "fqn" => + jsonWithoutDiscriminator.Deserialize( + options + ) + ?? throw new JsonException( + "Failed to deserialize CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldFqn" + ), + _ => json.Deserialize(options), + }; + return new DocSignaturesList200ResponseSignaturesItemField(discriminator, value); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesList200ResponseSignaturesItemField value, + JsonSerializerOptions options + ) + { + JsonNode json = + value.Kind switch + { + "objectNumber" => JsonSerializer.SerializeToNode(value.Value, options), + "fqn" => JsonSerializer.SerializeToNode(value.Value, options), + _ => JsonSerializer.SerializeToNode(value.Value, options), + } ?? new JsonObject(); + json["kind"] = value.Kind; + json.WriteTo(writer, options); + } + + public override DocSignaturesList200ResponseSignaturesItemField ReadAsPropertyName( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new JsonException("The JSON property name could not be read as a string."); + return new DocSignaturesList200ResponseSignaturesItemField(stringValue, stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesList200ResponseSignaturesItemField value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Kind); + } + } + + /// + /// Discriminated union type for objectNumber + /// + [Serializable] + public struct ObjectNumber + { + public ObjectNumber( + CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldObjectNumber value + ) + { + Value = value; + } + + internal CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldObjectNumber Value { get; set; } + + public override string ToString() => Value.ToString() ?? "null"; + + public static implicit operator DocSignaturesList200ResponseSignaturesItemField.ObjectNumber( + CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldObjectNumber value + ) => new(value); + } + + /// + /// Discriminated union type for fqn + /// + [Serializable] + public struct Fqn + { + public Fqn(CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldFqn value) + { + Value = value; + } + + internal CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldFqn Value { get; set; } + + public override string ToString() => Value.ToString() ?? "null"; + + public static implicit operator DocSignaturesList200ResponseSignaturesItemField.Fqn( + CloudPDF.DocSignaturesList200ResponseSignaturesItemFieldFqn value + ) => new(value); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldFqn.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldFqn.cs new file mode 100644 index 0000000..98c5ff0 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldFqn.cs @@ -0,0 +1,28 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseSignaturesItemFieldFqn : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required string Name { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldMdp.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldMdp.cs new file mode 100644 index 0000000..ef05565 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldMdp.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseSignaturesItemFieldMdp : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("action")] + public required DocSignaturesList200ResponseSignaturesItemFieldMdpAction Action { get; set; } + + [JsonPropertyName("fields")] + public IEnumerable Fields { get; set; } = new List(); + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldMdpAction.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldMdpAction.cs new file mode 100644 index 0000000..b445bd9 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldMdpAction.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesList200ResponseSignaturesItemFieldMdpAction.DocSignaturesList200ResponseSignaturesItemFieldMdpActionSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesList200ResponseSignaturesItemFieldMdpAction : IStringEnum +{ + public static readonly DocSignaturesList200ResponseSignaturesItemFieldMdpAction All = new( + Values.All + ); + + public static readonly DocSignaturesList200ResponseSignaturesItemFieldMdpAction Include = new( + Values.Include + ); + + public static readonly DocSignaturesList200ResponseSignaturesItemFieldMdpAction Exclude = new( + Values.Exclude + ); + + public DocSignaturesList200ResponseSignaturesItemFieldMdpAction(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesList200ResponseSignaturesItemFieldMdpAction FromCustom(string value) + { + return new DocSignaturesList200ResponseSignaturesItemFieldMdpAction(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesList200ResponseSignaturesItemFieldMdpAction value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesList200ResponseSignaturesItemFieldMdpAction value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesList200ResponseSignaturesItemFieldMdpAction value + ) => value.Value; + + public static explicit operator DocSignaturesList200ResponseSignaturesItemFieldMdpAction( + string value + ) => new(value); + + internal class DocSignaturesList200ResponseSignaturesItemFieldMdpActionSerializer + : JsonConverter + { + public override DocSignaturesList200ResponseSignaturesItemFieldMdpAction Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesList200ResponseSignaturesItemFieldMdpAction(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesList200ResponseSignaturesItemFieldMdpAction value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesList200ResponseSignaturesItemFieldMdpAction ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesList200ResponseSignaturesItemFieldMdpAction(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesList200ResponseSignaturesItemFieldMdpAction value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string All = "all"; + + public const string Include = "include"; + + public const string Exclude = "exclude"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldObjectNumber.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldObjectNumber.cs new file mode 100644 index 0000000..6b6d159 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemFieldObjectNumber.cs @@ -0,0 +1,28 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseSignaturesItemFieldObjectNumber : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("fieldObjectNumber")] + public required int FieldObjectNumber { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemKind.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemKind.cs new file mode 100644 index 0000000..bf4d963 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemKind.cs @@ -0,0 +1,128 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesList200ResponseSignaturesItemKind.DocSignaturesList200ResponseSignaturesItemKindSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesList200ResponseSignaturesItemKind : IStringEnum +{ + public static readonly DocSignaturesList200ResponseSignaturesItemKind Signature = new( + Values.Signature + ); + + public static readonly DocSignaturesList200ResponseSignaturesItemKind Timestamp = new( + Values.Timestamp + ); + + public DocSignaturesList200ResponseSignaturesItemKind(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesList200ResponseSignaturesItemKind FromCustom(string value) + { + return new DocSignaturesList200ResponseSignaturesItemKind(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesList200ResponseSignaturesItemKind value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesList200ResponseSignaturesItemKind value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesList200ResponseSignaturesItemKind value) => + value.Value; + + public static explicit operator DocSignaturesList200ResponseSignaturesItemKind(string value) => + new(value); + + internal class DocSignaturesList200ResponseSignaturesItemKindSerializer + : JsonConverter + { + public override DocSignaturesList200ResponseSignaturesItemKind Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesList200ResponseSignaturesItemKind(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesList200ResponseSignaturesItemKind value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesList200ResponseSignaturesItemKind ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesList200ResponseSignaturesItemKind(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesList200ResponseSignaturesItemKind value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Signature = "signature"; + + public const string Timestamp = "timestamp"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemLock.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemLock.cs new file mode 100644 index 0000000..5410ca8 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemLock.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseSignaturesItemLock : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("action")] + public required DocSignaturesList200ResponseSignaturesItemLockAction Action { get; set; } + + [JsonPropertyName("fields")] + public IEnumerable Fields { get; set; } = new List(); + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemLockAction.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemLockAction.cs new file mode 100644 index 0000000..a27630c --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemLockAction.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesList200ResponseSignaturesItemLockAction.DocSignaturesList200ResponseSignaturesItemLockActionSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesList200ResponseSignaturesItemLockAction : IStringEnum +{ + public static readonly DocSignaturesList200ResponseSignaturesItemLockAction All = new( + Values.All + ); + + public static readonly DocSignaturesList200ResponseSignaturesItemLockAction Include = new( + Values.Include + ); + + public static readonly DocSignaturesList200ResponseSignaturesItemLockAction Exclude = new( + Values.Exclude + ); + + public DocSignaturesList200ResponseSignaturesItemLockAction(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesList200ResponseSignaturesItemLockAction FromCustom(string value) + { + return new DocSignaturesList200ResponseSignaturesItemLockAction(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesList200ResponseSignaturesItemLockAction value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesList200ResponseSignaturesItemLockAction value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocSignaturesList200ResponseSignaturesItemLockAction value + ) => value.Value; + + public static explicit operator DocSignaturesList200ResponseSignaturesItemLockAction( + string value + ) => new(value); + + internal class DocSignaturesList200ResponseSignaturesItemLockActionSerializer + : JsonConverter + { + public override DocSignaturesList200ResponseSignaturesItemLockAction Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesList200ResponseSignaturesItemLockAction(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesList200ResponseSignaturesItemLockAction value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesList200ResponseSignaturesItemLockAction ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesList200ResponseSignaturesItemLockAction(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesList200ResponseSignaturesItemLockAction value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string All = "all"; + + public const string Include = "include"; + + public const string Exclude = "exclude"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemSeedValue.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemSeedValue.cs new file mode 100644 index 0000000..76221bf --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemSeedValue.cs @@ -0,0 +1,52 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseSignaturesItemSeedValue : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("requiredFlags")] + public required int RequiredFlags { get; set; } + + [JsonPropertyName("presentFlags")] + public required int PresentFlags { get; set; } + + [JsonPropertyName("version")] + public int? Version { get; set; } + + [JsonPropertyName("mdp")] + public double? Mdp { get; set; } + + [JsonPropertyName("filter")] + public string? Filter { get; set; } + + [JsonPropertyName("subFilters")] + public IEnumerable SubFilters { get; set; } = new List(); + + [JsonPropertyName("digestMethods")] + public IEnumerable DigestMethods { get; set; } = new List(); + + [JsonPropertyName("reasons")] + public IEnumerable Reasons { get; set; } = new List(); + + [JsonPropertyName("unsupportedRequired")] + public required bool UnsupportedRequired { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemSigner.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemSigner.cs new file mode 100644 index 0000000..5819946 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemSigner.cs @@ -0,0 +1,40 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseSignaturesItemSigner : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonPropertyName("reason")] + public string? Reason { get; set; } + + [JsonPropertyName("location")] + public string? Location { get; set; } + + [JsonPropertyName("contactInfo")] + public string? ContactInfo { get; set; } + + [JsonPropertyName("claimedTime")] + public string? ClaimedTime { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemWidget.cs b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemWidget.cs new file mode 100644 index 0000000..5834c5c --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList200ResponseSignaturesItemWidget.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList200ResponseSignaturesItemWidget : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("annotObjectNumber")] + public required int AnnotObjectNumber { get; set; } + + [JsonPropertyName("pageObjectNumber")] + public required int PageObjectNumber { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList404Response.cs b/src/CloudPDF/Types/DocSignaturesList404Response.cs new file mode 100644 index 0000000..4427d26 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList404Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesList404Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocSignaturesList404ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocSignaturesList404ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList404ResponseCode.cs b/src/CloudPDF/Types/DocSignaturesList404ResponseCode.cs new file mode 100644 index 0000000..f951c3c --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList404ResponseCode.cs @@ -0,0 +1,238 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter(typeof(DocSignaturesList404ResponseCode.DocSignaturesList404ResponseCodeSerializer))] +[Serializable] +public readonly record struct DocSignaturesList404ResponseCode : IStringEnum +{ + public static readonly DocSignaturesList404ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocSignaturesList404ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocSignaturesList404ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocSignaturesList404ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocSignaturesList404ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocSignaturesList404ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocSignaturesList404ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocSignaturesList404ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocSignaturesList404ResponseCode Network = new(Values.Network); + + public static readonly DocSignaturesList404ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocSignaturesList404ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocSignaturesList404ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocSignaturesList404ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocSignaturesList404ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocSignaturesList404ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocSignaturesList404ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocSignaturesList404ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocSignaturesList404ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocSignaturesList404ResponseCode MalformedPdf = new(Values.MalformedPdf); + + public static readonly DocSignaturesList404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocSignaturesList404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocSignaturesList404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocSignaturesList404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocSignaturesList404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocSignaturesList404ResponseCode StaleBase = new(Values.StaleBase); + + public DocSignaturesList404ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesList404ResponseCode FromCustom(string value) + { + return new DocSignaturesList404ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesList404ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesList404ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesList404ResponseCode value) => value.Value; + + public static explicit operator DocSignaturesList404ResponseCode(string value) => new(value); + + internal class DocSignaturesList404ResponseCodeSerializer + : JsonConverter + { + public override DocSignaturesList404ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesList404ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesList404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesList404ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesList404ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesList404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesList404ResponseName.cs b/src/CloudPDF/Types/DocSignaturesList404ResponseName.cs new file mode 100644 index 0000000..c80a9b4 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesList404ResponseName.cs @@ -0,0 +1,112 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter(typeof(DocSignaturesList404ResponseName.DocSignaturesList404ResponseNameSerializer))] +[Serializable] +public readonly record struct DocSignaturesList404ResponseName : IStringEnum +{ + public static readonly DocSignaturesList404ResponseName EngineError = new(Values.EngineError); + + public DocSignaturesList404ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesList404ResponseName FromCustom(string value) + { + return new DocSignaturesList404ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesList404ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesList404ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesList404ResponseName value) => value.Value; + + public static explicit operator DocSignaturesList404ResponseName(string value) => new(value); + + internal class DocSignaturesList404ResponseNameSerializer + : JsonConverter + { + public override DocSignaturesList404ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesList404ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesList404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesList404ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesList404ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesList404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare200Response.cs b/src/CloudPDF/Types/DocSignaturesPrepare200Response.cs new file mode 100644 index 0000000..d181479 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare200Response.cs @@ -0,0 +1,49 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesPrepare200Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("signingId")] + public required string SigningId { get; set; } + + [JsonPropertyName("digest")] + public required string Digest { get; set; } + + [JsonPropertyName("algorithm")] + public required DocSignaturesPrepare200ResponseAlgorithm Algorithm { get; set; } + + [JsonPropertyName("byteRange")] + public IEnumerable ByteRange { get; set; } = new List(); + + [JsonPropertyName("contentsSize")] + public required int ContentsSize { get; set; } + + [JsonPropertyName("subFilter")] + public required string SubFilter { get; set; } + + [JsonPropertyName("expectedVersion")] + public required DocSignaturesPrepare200ResponseExpectedVersion ExpectedVersion { get; set; } + + [JsonPropertyName("expiresAt")] + public string? ExpiresAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare200ResponseAlgorithm.cs b/src/CloudPDF/Types/DocSignaturesPrepare200ResponseAlgorithm.cs new file mode 100644 index 0000000..bc855de --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare200ResponseAlgorithm.cs @@ -0,0 +1,128 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesPrepare200ResponseAlgorithm.DocSignaturesPrepare200ResponseAlgorithmSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesPrepare200ResponseAlgorithm : IStringEnum +{ + public static readonly DocSignaturesPrepare200ResponseAlgorithm Sha256 = new(Values.Sha256); + + public static readonly DocSignaturesPrepare200ResponseAlgorithm Sha384 = new(Values.Sha384); + + public static readonly DocSignaturesPrepare200ResponseAlgorithm Sha512 = new(Values.Sha512); + + public DocSignaturesPrepare200ResponseAlgorithm(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesPrepare200ResponseAlgorithm FromCustom(string value) + { + return new DocSignaturesPrepare200ResponseAlgorithm(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocSignaturesPrepare200ResponseAlgorithm value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocSignaturesPrepare200ResponseAlgorithm value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesPrepare200ResponseAlgorithm value) => + value.Value; + + public static explicit operator DocSignaturesPrepare200ResponseAlgorithm(string value) => + new(value); + + internal class DocSignaturesPrepare200ResponseAlgorithmSerializer + : JsonConverter + { + public override DocSignaturesPrepare200ResponseAlgorithm Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesPrepare200ResponseAlgorithm(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesPrepare200ResponseAlgorithm value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesPrepare200ResponseAlgorithm ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesPrepare200ResponseAlgorithm(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesPrepare200ResponseAlgorithm value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Sha256 = "sha256"; + + public const string Sha384 = "sha384"; + + public const string Sha512 = "sha512"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare200ResponseExpectedVersion.cs b/src/CloudPDF/Types/DocSignaturesPrepare200ResponseExpectedVersion.cs new file mode 100644 index 0000000..657cda0 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare200ResponseExpectedVersion.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesPrepare200ResponseExpectedVersion : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("baseSha256")] + public required string BaseSha256 { get; set; } + + [JsonPropertyName("editsVersion")] + public required int EditsVersion { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare400Response.cs b/src/CloudPDF/Types/DocSignaturesPrepare400Response.cs new file mode 100644 index 0000000..7098646 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare400Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesPrepare400Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocSignaturesPrepare400ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocSignaturesPrepare400ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare400ResponseCode.cs b/src/CloudPDF/Types/DocSignaturesPrepare400ResponseCode.cs new file mode 100644 index 0000000..9e261c6 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare400ResponseCode.cs @@ -0,0 +1,243 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesPrepare400ResponseCode.DocSignaturesPrepare400ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesPrepare400ResponseCode : IStringEnum +{ + public static readonly DocSignaturesPrepare400ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocSignaturesPrepare400ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocSignaturesPrepare400ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocSignaturesPrepare400ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocSignaturesPrepare400ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocSignaturesPrepare400ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocSignaturesPrepare400ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocSignaturesPrepare400ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocSignaturesPrepare400ResponseCode Network = new(Values.Network); + + public static readonly DocSignaturesPrepare400ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocSignaturesPrepare400ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocSignaturesPrepare400ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocSignaturesPrepare400ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocSignaturesPrepare400ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocSignaturesPrepare400ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocSignaturesPrepare400ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocSignaturesPrepare400ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocSignaturesPrepare400ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocSignaturesPrepare400ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocSignaturesPrepare400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocSignaturesPrepare400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocSignaturesPrepare400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocSignaturesPrepare400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocSignaturesPrepare400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocSignaturesPrepare400ResponseCode StaleBase = new(Values.StaleBase); + + public DocSignaturesPrepare400ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesPrepare400ResponseCode FromCustom(string value) + { + return new DocSignaturesPrepare400ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesPrepare400ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesPrepare400ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesPrepare400ResponseCode value) => + value.Value; + + public static explicit operator DocSignaturesPrepare400ResponseCode(string value) => new(value); + + internal class DocSignaturesPrepare400ResponseCodeSerializer + : JsonConverter + { + public override DocSignaturesPrepare400ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesPrepare400ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesPrepare400ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesPrepare400ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesPrepare400ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesPrepare400ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare400ResponseName.cs b/src/CloudPDF/Types/DocSignaturesPrepare400ResponseName.cs new file mode 100644 index 0000000..e482c58 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare400ResponseName.cs @@ -0,0 +1,117 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesPrepare400ResponseName.DocSignaturesPrepare400ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesPrepare400ResponseName : IStringEnum +{ + public static readonly DocSignaturesPrepare400ResponseName EngineError = new( + Values.EngineError + ); + + public DocSignaturesPrepare400ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesPrepare400ResponseName FromCustom(string value) + { + return new DocSignaturesPrepare400ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesPrepare400ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesPrepare400ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesPrepare400ResponseName value) => + value.Value; + + public static explicit operator DocSignaturesPrepare400ResponseName(string value) => new(value); + + internal class DocSignaturesPrepare400ResponseNameSerializer + : JsonConverter + { + public override DocSignaturesPrepare400ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesPrepare400ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesPrepare400ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesPrepare400ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesPrepare400ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesPrepare400ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare404Response.cs b/src/CloudPDF/Types/DocSignaturesPrepare404Response.cs new file mode 100644 index 0000000..193278a --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare404Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesPrepare404Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocSignaturesPrepare404ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocSignaturesPrepare404ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare404ResponseCode.cs b/src/CloudPDF/Types/DocSignaturesPrepare404ResponseCode.cs new file mode 100644 index 0000000..e3cf076 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare404ResponseCode.cs @@ -0,0 +1,243 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesPrepare404ResponseCode.DocSignaturesPrepare404ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesPrepare404ResponseCode : IStringEnum +{ + public static readonly DocSignaturesPrepare404ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocSignaturesPrepare404ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocSignaturesPrepare404ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocSignaturesPrepare404ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocSignaturesPrepare404ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocSignaturesPrepare404ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocSignaturesPrepare404ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocSignaturesPrepare404ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocSignaturesPrepare404ResponseCode Network = new(Values.Network); + + public static readonly DocSignaturesPrepare404ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocSignaturesPrepare404ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocSignaturesPrepare404ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocSignaturesPrepare404ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocSignaturesPrepare404ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocSignaturesPrepare404ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocSignaturesPrepare404ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocSignaturesPrepare404ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocSignaturesPrepare404ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocSignaturesPrepare404ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocSignaturesPrepare404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocSignaturesPrepare404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocSignaturesPrepare404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocSignaturesPrepare404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocSignaturesPrepare404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocSignaturesPrepare404ResponseCode StaleBase = new(Values.StaleBase); + + public DocSignaturesPrepare404ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesPrepare404ResponseCode FromCustom(string value) + { + return new DocSignaturesPrepare404ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesPrepare404ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesPrepare404ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesPrepare404ResponseCode value) => + value.Value; + + public static explicit operator DocSignaturesPrepare404ResponseCode(string value) => new(value); + + internal class DocSignaturesPrepare404ResponseCodeSerializer + : JsonConverter + { + public override DocSignaturesPrepare404ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesPrepare404ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesPrepare404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesPrepare404ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesPrepare404ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesPrepare404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare404ResponseName.cs b/src/CloudPDF/Types/DocSignaturesPrepare404ResponseName.cs new file mode 100644 index 0000000..a130734 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare404ResponseName.cs @@ -0,0 +1,117 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesPrepare404ResponseName.DocSignaturesPrepare404ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesPrepare404ResponseName : IStringEnum +{ + public static readonly DocSignaturesPrepare404ResponseName EngineError = new( + Values.EngineError + ); + + public DocSignaturesPrepare404ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesPrepare404ResponseName FromCustom(string value) + { + return new DocSignaturesPrepare404ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesPrepare404ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesPrepare404ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesPrepare404ResponseName value) => + value.Value; + + public static explicit operator DocSignaturesPrepare404ResponseName(string value) => new(value); + + internal class DocSignaturesPrepare404ResponseNameSerializer + : JsonConverter + { + public override DocSignaturesPrepare404ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesPrepare404ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesPrepare404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesPrepare404ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesPrepare404ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesPrepare404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare409Response.cs b/src/CloudPDF/Types/DocSignaturesPrepare409Response.cs new file mode 100644 index 0000000..a122f65 --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare409Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocSignaturesPrepare409Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocSignaturesPrepare409ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocSignaturesPrepare409ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare409ResponseCode.cs b/src/CloudPDF/Types/DocSignaturesPrepare409ResponseCode.cs new file mode 100644 index 0000000..cc27a3d --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare409ResponseCode.cs @@ -0,0 +1,243 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesPrepare409ResponseCode.DocSignaturesPrepare409ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesPrepare409ResponseCode : IStringEnum +{ + public static readonly DocSignaturesPrepare409ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocSignaturesPrepare409ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocSignaturesPrepare409ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocSignaturesPrepare409ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocSignaturesPrepare409ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocSignaturesPrepare409ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocSignaturesPrepare409ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocSignaturesPrepare409ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocSignaturesPrepare409ResponseCode Network = new(Values.Network); + + public static readonly DocSignaturesPrepare409ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocSignaturesPrepare409ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocSignaturesPrepare409ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocSignaturesPrepare409ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocSignaturesPrepare409ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocSignaturesPrepare409ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocSignaturesPrepare409ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocSignaturesPrepare409ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocSignaturesPrepare409ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocSignaturesPrepare409ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocSignaturesPrepare409ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocSignaturesPrepare409ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocSignaturesPrepare409ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocSignaturesPrepare409ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocSignaturesPrepare409ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocSignaturesPrepare409ResponseCode StaleBase = new(Values.StaleBase); + + public DocSignaturesPrepare409ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesPrepare409ResponseCode FromCustom(string value) + { + return new DocSignaturesPrepare409ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesPrepare409ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesPrepare409ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesPrepare409ResponseCode value) => + value.Value; + + public static explicit operator DocSignaturesPrepare409ResponseCode(string value) => new(value); + + internal class DocSignaturesPrepare409ResponseCodeSerializer + : JsonConverter + { + public override DocSignaturesPrepare409ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesPrepare409ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesPrepare409ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesPrepare409ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesPrepare409ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesPrepare409ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocSignaturesPrepare409ResponseName.cs b/src/CloudPDF/Types/DocSignaturesPrepare409ResponseName.cs new file mode 100644 index 0000000..1176c1c --- /dev/null +++ b/src/CloudPDF/Types/DocSignaturesPrepare409ResponseName.cs @@ -0,0 +1,117 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocSignaturesPrepare409ResponseName.DocSignaturesPrepare409ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocSignaturesPrepare409ResponseName : IStringEnum +{ + public static readonly DocSignaturesPrepare409ResponseName EngineError = new( + Values.EngineError + ); + + public DocSignaturesPrepare409ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocSignaturesPrepare409ResponseName FromCustom(string value) + { + return new DocSignaturesPrepare409ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocSignaturesPrepare409ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocSignaturesPrepare409ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocSignaturesPrepare409ResponseName value) => + value.Value; + + public static explicit operator DocSignaturesPrepare409ResponseName(string value) => new(value); + + internal class DocSignaturesPrepare409ResponseNameSerializer + : JsonConverter + { + public override DocSignaturesPrepare409ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocSignaturesPrepare409ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocSignaturesPrepare409ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocSignaturesPrepare409ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocSignaturesPrepare409ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocSignaturesPrepare409ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocText404ResponseCode.cs b/src/CloudPDF/Types/DocText404ResponseCode.cs index ce9ca0e..02b3553 100644 --- a/src/CloudPDF/Types/DocText404ResponseCode.cs +++ b/src/CloudPDF/Types/DocText404ResponseCode.cs @@ -58,6 +58,20 @@ namespace CloudPDF; public static readonly DocText404ResponseCode MalformedPdf = new(Values.MalformedPdf); + public static readonly DocText404ResponseCode SigningPending = new(Values.SigningPending); + + public static readonly DocText404ResponseCode SigningExpired = new(Values.SigningExpired); + + public static readonly DocText404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocText404ResponseCode SignatureRefused = new(Values.SignatureRefused); + + public static readonly DocText404ResponseCode ProtectedDocument = new(Values.ProtectedDocument); + + public static readonly DocText404ResponseCode StaleBase = new(Values.StaleBase); + public DocText404ResponseCode(string value) { Value = value; @@ -191,5 +205,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } } diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200Response.cs b/src/CloudPDF/Types/DocVersionsAnalysis200Response.cs new file mode 100644 index 0000000..4b93d48 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200Response.cs @@ -0,0 +1,56 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis200Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("mode")] + public required DocVersionsAnalysis200ResponseMode Mode { get; set; } + + [JsonPropertyName("policyVersion")] + public required int PolicyVersion { get; set; } + + [JsonPropertyName("basis")] + public required DocVersionsAnalysis200ResponseBasis Basis { get; set; } + + [JsonPropertyName("since")] + public required DocVersionsAnalysis200ResponseSince Since { get; set; } + + [JsonPropertyName("until")] + public required DocVersionsAnalysis200ResponseUntil Until { get; set; } + + [JsonPropertyName("restrictions")] + public IEnumerable Restrictions { get; set; } = + new List(); + + [JsonPropertyName("current")] + public required DocVersionsAnalysis200ResponseCurrent Current { get; set; } + + [JsonPropertyName("later")] + public required DocVersionsAnalysis200ResponseLater Later { get; set; } + + [JsonPropertyName("verdict")] + public required DocVersionsAnalysis200ResponseVerdict Verdict { get; set; } + + [JsonPropertyName("steps")] + public IEnumerable Steps { get; set; } = new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasis.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasis.cs new file mode 100644 index 0000000..cf61571 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasis.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis200ResponseBasis : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("version")] + public required DocVersionsAnalysis200ResponseBasisVersion Version { get; set; } + + [JsonPropertyName("editsVersion")] + public required int EditsVersion { get; set; } + + [JsonPropertyName("source")] + public required DocVersionsAnalysis200ResponseBasisSource Source { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasisSource.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasisSource.cs new file mode 100644 index 0000000..1869c91 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasisSource.cs @@ -0,0 +1,128 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis200ResponseBasisSource.DocVersionsAnalysis200ResponseBasisSourceSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis200ResponseBasisSource : IStringEnum +{ + public static readonly DocVersionsAnalysis200ResponseBasisSource Persisted = new( + Values.Persisted + ); + + public static readonly DocVersionsAnalysis200ResponseBasisSource WorkingCopy = new( + Values.WorkingCopy + ); + + public DocVersionsAnalysis200ResponseBasisSource(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis200ResponseBasisSource FromCustom(string value) + { + return new DocVersionsAnalysis200ResponseBasisSource(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsAnalysis200ResponseBasisSource value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsAnalysis200ResponseBasisSource value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsAnalysis200ResponseBasisSource value) => + value.Value; + + public static explicit operator DocVersionsAnalysis200ResponseBasisSource(string value) => + new(value); + + internal class DocVersionsAnalysis200ResponseBasisSourceSerializer + : JsonConverter + { + public override DocVersionsAnalysis200ResponseBasisSource Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseBasisSource(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseBasisSource value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis200ResponseBasisSource ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseBasisSource(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseBasisSource value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Persisted = "persisted"; + + public const string WorkingCopy = "working-copy"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasisVersion.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasisVersion.cs new file mode 100644 index 0000000..9403280 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseBasisVersion.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis200ResponseBasisVersion : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("sha256")] + public required string Sha256 { get; set; } + + [JsonPropertyName("byteLength")] + public required int ByteLength { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrent.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrent.cs new file mode 100644 index 0000000..4cc5ca6 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrent.cs @@ -0,0 +1,41 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis200ResponseCurrent : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("verdict")] + public required DocVersionsAnalysis200ResponseCurrentVerdict Verdict { get; set; } + + [JsonPropertyName("complete")] + public required bool Complete { get; set; } + + [JsonPropertyName("primary")] + public DocVersionsAnalysis200ResponseCurrentPrimary? Primary { get; set; } + + [JsonPropertyName("findings")] + public IEnumerable Findings { get; set; } = + new List(); + + [JsonPropertyName("method")] + public required DocVersionsAnalysis200ResponseCurrentMethod Method { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentFindingsItem.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentFindingsItem.cs new file mode 100644 index 0000000..58147b5 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentFindingsItem.cs @@ -0,0 +1,40 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis200ResponseCurrentFindingsItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("rule")] + public required string Rule { get; set; } + + [JsonPropertyName("verdict")] + public required DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict Verdict { get; set; } + + [JsonPropertyName("objectNumber")] + public required int ObjectNumber { get; set; } + + [JsonPropertyName("edge")] + public string? Edge { get; set; } + + [JsonPropertyName("detail")] + public string? Detail { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict.cs new file mode 100644 index 0000000..d88e46a --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict.cs @@ -0,0 +1,135 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict.DocVersionsAnalysis200ResponseCurrentFindingsItemVerdictSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict : IStringEnum +{ + public static readonly DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict Permitted = new( + Values.Permitted + ); + + public static readonly DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict Forbidden = new( + Values.Forbidden + ); + + public static readonly DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict Incomplete = + new(Values.Incomplete); + + public DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict FromCustom(string value) + { + return new DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict value + ) => value.Value; + + public static explicit operator DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict( + string value + ) => new(value); + + internal class DocVersionsAnalysis200ResponseCurrentFindingsItemVerdictSerializer + : JsonConverter + { + public override DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Permitted = "permitted"; + + public const string Forbidden = "forbidden"; + + public const string Incomplete = "incomplete"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentMethod.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentMethod.cs new file mode 100644 index 0000000..f9df554 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentMethod.cs @@ -0,0 +1,128 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis200ResponseCurrentMethod.DocVersionsAnalysis200ResponseCurrentMethodSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis200ResponseCurrentMethod : IStringEnum +{ + public static readonly DocVersionsAnalysis200ResponseCurrentMethod NetState = new( + Values.NetState + ); + + public static readonly DocVersionsAnalysis200ResponseCurrentMethod NetStateReplay = new( + Values.NetStateReplay + ); + + public DocVersionsAnalysis200ResponseCurrentMethod(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis200ResponseCurrentMethod FromCustom(string value) + { + return new DocVersionsAnalysis200ResponseCurrentMethod(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsAnalysis200ResponseCurrentMethod value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsAnalysis200ResponseCurrentMethod value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsAnalysis200ResponseCurrentMethod value) => + value.Value; + + public static explicit operator DocVersionsAnalysis200ResponseCurrentMethod(string value) => + new(value); + + internal class DocVersionsAnalysis200ResponseCurrentMethodSerializer + : JsonConverter + { + public override DocVersionsAnalysis200ResponseCurrentMethod Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseCurrentMethod(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseCurrentMethod value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis200ResponseCurrentMethod ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseCurrentMethod(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseCurrentMethod value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string NetState = "net-state"; + + public const string NetStateReplay = "net-state+replay"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentPrimary.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentPrimary.cs new file mode 100644 index 0000000..9a0b65f --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentPrimary.cs @@ -0,0 +1,40 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis200ResponseCurrentPrimary : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("rule")] + public required string Rule { get; set; } + + [JsonPropertyName("verdict")] + public required DocVersionsAnalysis200ResponseCurrentPrimaryVerdict Verdict { get; set; } + + [JsonPropertyName("objectNumber")] + public required int ObjectNumber { get; set; } + + [JsonPropertyName("edge")] + public string? Edge { get; set; } + + [JsonPropertyName("detail")] + public string? Detail { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentPrimaryVerdict.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentPrimaryVerdict.cs new file mode 100644 index 0000000..04c2bf7 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentPrimaryVerdict.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis200ResponseCurrentPrimaryVerdict.DocVersionsAnalysis200ResponseCurrentPrimaryVerdictSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis200ResponseCurrentPrimaryVerdict : IStringEnum +{ + public static readonly DocVersionsAnalysis200ResponseCurrentPrimaryVerdict Permitted = new( + Values.Permitted + ); + + public static readonly DocVersionsAnalysis200ResponseCurrentPrimaryVerdict Forbidden = new( + Values.Forbidden + ); + + public static readonly DocVersionsAnalysis200ResponseCurrentPrimaryVerdict Incomplete = new( + Values.Incomplete + ); + + public DocVersionsAnalysis200ResponseCurrentPrimaryVerdict(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis200ResponseCurrentPrimaryVerdict FromCustom(string value) + { + return new DocVersionsAnalysis200ResponseCurrentPrimaryVerdict(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsAnalysis200ResponseCurrentPrimaryVerdict value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsAnalysis200ResponseCurrentPrimaryVerdict value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocVersionsAnalysis200ResponseCurrentPrimaryVerdict value + ) => value.Value; + + public static explicit operator DocVersionsAnalysis200ResponseCurrentPrimaryVerdict( + string value + ) => new(value); + + internal class DocVersionsAnalysis200ResponseCurrentPrimaryVerdictSerializer + : JsonConverter + { + public override DocVersionsAnalysis200ResponseCurrentPrimaryVerdict Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseCurrentPrimaryVerdict(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseCurrentPrimaryVerdict value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis200ResponseCurrentPrimaryVerdict ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseCurrentPrimaryVerdict(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseCurrentPrimaryVerdict value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Permitted = "permitted"; + + public const string Forbidden = "forbidden"; + + public const string Incomplete = "incomplete"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentVerdict.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentVerdict.cs new file mode 100644 index 0000000..85345df --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseCurrentVerdict.cs @@ -0,0 +1,140 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis200ResponseCurrentVerdict.DocVersionsAnalysis200ResponseCurrentVerdictSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis200ResponseCurrentVerdict : IStringEnum +{ + public static readonly DocVersionsAnalysis200ResponseCurrentVerdict Unchanged = new( + Values.Unchanged + ); + + public static readonly DocVersionsAnalysis200ResponseCurrentVerdict Permitted = new( + Values.Permitted + ); + + public static readonly DocVersionsAnalysis200ResponseCurrentVerdict Forbidden = new( + Values.Forbidden + ); + + public static readonly DocVersionsAnalysis200ResponseCurrentVerdict Indeterminate = new( + Values.Indeterminate + ); + + public DocVersionsAnalysis200ResponseCurrentVerdict(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis200ResponseCurrentVerdict FromCustom(string value) + { + return new DocVersionsAnalysis200ResponseCurrentVerdict(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsAnalysis200ResponseCurrentVerdict value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsAnalysis200ResponseCurrentVerdict value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsAnalysis200ResponseCurrentVerdict value) => + value.Value; + + public static explicit operator DocVersionsAnalysis200ResponseCurrentVerdict(string value) => + new(value); + + internal class DocVersionsAnalysis200ResponseCurrentVerdictSerializer + : JsonConverter + { + public override DocVersionsAnalysis200ResponseCurrentVerdict Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseCurrentVerdict(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseCurrentVerdict value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis200ResponseCurrentVerdict ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseCurrentVerdict(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseCurrentVerdict value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unchanged = "unchanged"; + + public const string Permitted = "permitted"; + + public const string Forbidden = "forbidden"; + + public const string Indeterminate = "indeterminate"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseLater.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseLater.cs new file mode 100644 index 0000000..ce3a68a --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseLater.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis200ResponseLater : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("revisionCount")] + public required int RevisionCount { get; set; } + + [JsonPropertyName("undoneObjectNumbers")] + public IEnumerable UndoneObjectNumbers { get; set; } = new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseMode.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseMode.cs new file mode 100644 index 0000000..3c8b3dd --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseMode.cs @@ -0,0 +1,120 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis200ResponseMode.DocVersionsAnalysis200ResponseModeSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis200ResponseMode : IStringEnum +{ + public static readonly DocVersionsAnalysis200ResponseMode Authoritative = new( + Values.Authoritative + ); + + public static readonly DocVersionsAnalysis200ResponseMode Exploratory = new(Values.Exploratory); + + public DocVersionsAnalysis200ResponseMode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis200ResponseMode FromCustom(string value) + { + return new DocVersionsAnalysis200ResponseMode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsAnalysis200ResponseMode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsAnalysis200ResponseMode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsAnalysis200ResponseMode value) => value.Value; + + public static explicit operator DocVersionsAnalysis200ResponseMode(string value) => new(value); + + internal class DocVersionsAnalysis200ResponseModeSerializer + : JsonConverter + { + public override DocVersionsAnalysis200ResponseMode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseMode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseMode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis200ResponseMode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseMode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseMode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Authoritative = "authoritative"; + + public const string Exploratory = "exploratory"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseRestrictionsItem.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseRestrictionsItem.cs new file mode 100644 index 0000000..40f5f94 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseRestrictionsItem.cs @@ -0,0 +1,43 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis200ResponseRestrictionsItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("signatureIndex")] + public required int SignatureIndex { get; set; } + + [JsonPropertyName("revisionIndex")] + public required int RevisionIndex { get; set; } + + [JsonPropertyName("source")] + public required DocVersionsAnalysis200ResponseRestrictionsItemSource Source { get; set; } + + [JsonPropertyName("own")] + public required bool Own { get; set; } + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonPropertyName("fields")] + public object? Fields { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseRestrictionsItemSource.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseRestrictionsItemSource.cs new file mode 100644 index 0000000..6ed8389 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseRestrictionsItemSource.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis200ResponseRestrictionsItemSource.DocVersionsAnalysis200ResponseRestrictionsItemSourceSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis200ResponseRestrictionsItemSource : IStringEnum +{ + public static readonly DocVersionsAnalysis200ResponseRestrictionsItemSource Docmdp = new( + Values.Docmdp + ); + + public static readonly DocVersionsAnalysis200ResponseRestrictionsItemSource Fieldmdp = new( + Values.Fieldmdp + ); + + public static readonly DocVersionsAnalysis200ResponseRestrictionsItemSource Lock = new( + Values.Lock + ); + + public DocVersionsAnalysis200ResponseRestrictionsItemSource(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis200ResponseRestrictionsItemSource FromCustom(string value) + { + return new DocVersionsAnalysis200ResponseRestrictionsItemSource(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsAnalysis200ResponseRestrictionsItemSource value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsAnalysis200ResponseRestrictionsItemSource value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocVersionsAnalysis200ResponseRestrictionsItemSource value + ) => value.Value; + + public static explicit operator DocVersionsAnalysis200ResponseRestrictionsItemSource( + string value + ) => new(value); + + internal class DocVersionsAnalysis200ResponseRestrictionsItemSourceSerializer + : JsonConverter + { + public override DocVersionsAnalysis200ResponseRestrictionsItemSource Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseRestrictionsItemSource(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseRestrictionsItemSource value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis200ResponseRestrictionsItemSource ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseRestrictionsItemSource(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseRestrictionsItemSource value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Docmdp = "docmdp"; + + public const string Fieldmdp = "fieldmdp"; + + public const string Lock = "lock"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseSince.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseSince.cs new file mode 100644 index 0000000..20f1e97 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseSince.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis200ResponseSince : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("revisionIndex")] + public required int RevisionIndex { get; set; } + + [JsonPropertyName("signatureIndex")] + public int? SignatureIndex { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseUntil.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseUntil.cs new file mode 100644 index 0000000..c70a175 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseUntil.cs @@ -0,0 +1,28 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis200ResponseUntil : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("revisionIndex")] + public required int RevisionIndex { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis200ResponseVerdict.cs b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseVerdict.cs new file mode 100644 index 0000000..5f2100c --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis200ResponseVerdict.cs @@ -0,0 +1,130 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis200ResponseVerdict.DocVersionsAnalysis200ResponseVerdictSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis200ResponseVerdict : IStringEnum +{ + public static readonly DocVersionsAnalysis200ResponseVerdict Unchanged = new(Values.Unchanged); + + public static readonly DocVersionsAnalysis200ResponseVerdict Permitted = new(Values.Permitted); + + public static readonly DocVersionsAnalysis200ResponseVerdict Forbidden = new(Values.Forbidden); + + public static readonly DocVersionsAnalysis200ResponseVerdict Indeterminate = new( + Values.Indeterminate + ); + + public DocVersionsAnalysis200ResponseVerdict(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis200ResponseVerdict FromCustom(string value) + { + return new DocVersionsAnalysis200ResponseVerdict(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsAnalysis200ResponseVerdict value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsAnalysis200ResponseVerdict value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsAnalysis200ResponseVerdict value) => + value.Value; + + public static explicit operator DocVersionsAnalysis200ResponseVerdict(string value) => + new(value); + + internal class DocVersionsAnalysis200ResponseVerdictSerializer + : JsonConverter + { + public override DocVersionsAnalysis200ResponseVerdict Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseVerdict(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseVerdict value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis200ResponseVerdict ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis200ResponseVerdict(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis200ResponseVerdict value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unchanged = "unchanged"; + + public const string Permitted = "permitted"; + + public const string Forbidden = "forbidden"; + + public const string Indeterminate = "indeterminate"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis400Response.cs b/src/CloudPDF/Types/DocVersionsAnalysis400Response.cs new file mode 100644 index 0000000..673d2d6 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis400Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis400Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocVersionsAnalysis400ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocVersionsAnalysis400ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis400ResponseCode.cs b/src/CloudPDF/Types/DocVersionsAnalysis400ResponseCode.cs new file mode 100644 index 0000000..31da142 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis400ResponseCode.cs @@ -0,0 +1,242 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis400ResponseCode.DocVersionsAnalysis400ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis400ResponseCode : IStringEnum +{ + public static readonly DocVersionsAnalysis400ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocVersionsAnalysis400ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocVersionsAnalysis400ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocVersionsAnalysis400ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocVersionsAnalysis400ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocVersionsAnalysis400ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocVersionsAnalysis400ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocVersionsAnalysis400ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocVersionsAnalysis400ResponseCode Network = new(Values.Network); + + public static readonly DocVersionsAnalysis400ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocVersionsAnalysis400ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocVersionsAnalysis400ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocVersionsAnalysis400ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocVersionsAnalysis400ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocVersionsAnalysis400ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocVersionsAnalysis400ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocVersionsAnalysis400ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocVersionsAnalysis400ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocVersionsAnalysis400ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocVersionsAnalysis400ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocVersionsAnalysis400ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocVersionsAnalysis400ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocVersionsAnalysis400ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocVersionsAnalysis400ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocVersionsAnalysis400ResponseCode StaleBase = new(Values.StaleBase); + + public DocVersionsAnalysis400ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis400ResponseCode FromCustom(string value) + { + return new DocVersionsAnalysis400ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsAnalysis400ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsAnalysis400ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsAnalysis400ResponseCode value) => value.Value; + + public static explicit operator DocVersionsAnalysis400ResponseCode(string value) => new(value); + + internal class DocVersionsAnalysis400ResponseCodeSerializer + : JsonConverter + { + public override DocVersionsAnalysis400ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis400ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis400ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis400ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis400ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis400ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis400ResponseName.cs b/src/CloudPDF/Types/DocVersionsAnalysis400ResponseName.cs new file mode 100644 index 0000000..cbccc29 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis400ResponseName.cs @@ -0,0 +1,114 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis400ResponseName.DocVersionsAnalysis400ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis400ResponseName : IStringEnum +{ + public static readonly DocVersionsAnalysis400ResponseName EngineError = new(Values.EngineError); + + public DocVersionsAnalysis400ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis400ResponseName FromCustom(string value) + { + return new DocVersionsAnalysis400ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsAnalysis400ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsAnalysis400ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsAnalysis400ResponseName value) => value.Value; + + public static explicit operator DocVersionsAnalysis400ResponseName(string value) => new(value); + + internal class DocVersionsAnalysis400ResponseNameSerializer + : JsonConverter + { + public override DocVersionsAnalysis400ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis400ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis400ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis400ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis400ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis400ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis404Response.cs b/src/CloudPDF/Types/DocVersionsAnalysis404Response.cs new file mode 100644 index 0000000..91bfc52 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis404Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsAnalysis404Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocVersionsAnalysis404ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocVersionsAnalysis404ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis404ResponseCode.cs b/src/CloudPDF/Types/DocVersionsAnalysis404ResponseCode.cs new file mode 100644 index 0000000..c3d8ba9 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis404ResponseCode.cs @@ -0,0 +1,242 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis404ResponseCode.DocVersionsAnalysis404ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis404ResponseCode : IStringEnum +{ + public static readonly DocVersionsAnalysis404ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocVersionsAnalysis404ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocVersionsAnalysis404ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocVersionsAnalysis404ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocVersionsAnalysis404ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocVersionsAnalysis404ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocVersionsAnalysis404ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocVersionsAnalysis404ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocVersionsAnalysis404ResponseCode Network = new(Values.Network); + + public static readonly DocVersionsAnalysis404ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocVersionsAnalysis404ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocVersionsAnalysis404ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocVersionsAnalysis404ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocVersionsAnalysis404ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocVersionsAnalysis404ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocVersionsAnalysis404ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocVersionsAnalysis404ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocVersionsAnalysis404ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocVersionsAnalysis404ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocVersionsAnalysis404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocVersionsAnalysis404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocVersionsAnalysis404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocVersionsAnalysis404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocVersionsAnalysis404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocVersionsAnalysis404ResponseCode StaleBase = new(Values.StaleBase); + + public DocVersionsAnalysis404ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis404ResponseCode FromCustom(string value) + { + return new DocVersionsAnalysis404ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsAnalysis404ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsAnalysis404ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsAnalysis404ResponseCode value) => value.Value; + + public static explicit operator DocVersionsAnalysis404ResponseCode(string value) => new(value); + + internal class DocVersionsAnalysis404ResponseCodeSerializer + : JsonConverter + { + public override DocVersionsAnalysis404ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis404ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis404ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis404ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsAnalysis404ResponseName.cs b/src/CloudPDF/Types/DocVersionsAnalysis404ResponseName.cs new file mode 100644 index 0000000..20eaa9c --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsAnalysis404ResponseName.cs @@ -0,0 +1,114 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsAnalysis404ResponseName.DocVersionsAnalysis404ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocVersionsAnalysis404ResponseName : IStringEnum +{ + public static readonly DocVersionsAnalysis404ResponseName EngineError = new(Values.EngineError); + + public DocVersionsAnalysis404ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsAnalysis404ResponseName FromCustom(string value) + { + return new DocVersionsAnalysis404ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsAnalysis404ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsAnalysis404ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsAnalysis404ResponseName value) => value.Value; + + public static explicit operator DocVersionsAnalysis404ResponseName(string value) => new(value); + + internal class DocVersionsAnalysis404ResponseNameSerializer + : JsonConverter + { + public override DocVersionsAnalysis404ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsAnalysis404ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsAnalysis404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsAnalysis404ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsAnalysis404ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsAnalysis404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsDownloadResponse.cs b/src/CloudPDF/Types/DocVersionsDownloadResponse.cs new file mode 100644 index 0000000..93b549f --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsDownloadResponse.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsDownloadResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocVersionsDownloadResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocVersionsDownloadResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsDownloadResponseCode.cs b/src/CloudPDF/Types/DocVersionsDownloadResponseCode.cs new file mode 100644 index 0000000..96f2f7c --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsDownloadResponseCode.cs @@ -0,0 +1,238 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter(typeof(DocVersionsDownloadResponseCode.DocVersionsDownloadResponseCodeSerializer))] +[Serializable] +public readonly record struct DocVersionsDownloadResponseCode : IStringEnum +{ + public static readonly DocVersionsDownloadResponseCode Unknown = new(Values.Unknown); + + public static readonly DocVersionsDownloadResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocVersionsDownloadResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocVersionsDownloadResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocVersionsDownloadResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocVersionsDownloadResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocVersionsDownloadResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocVersionsDownloadResponseCode Aborted = new(Values.Aborted); + + public static readonly DocVersionsDownloadResponseCode Network = new(Values.Network); + + public static readonly DocVersionsDownloadResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocVersionsDownloadResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocVersionsDownloadResponseCode NotFound = new(Values.NotFound); + + public static readonly DocVersionsDownloadResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocVersionsDownloadResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocVersionsDownloadResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocVersionsDownloadResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocVersionsDownloadResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocVersionsDownloadResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocVersionsDownloadResponseCode MalformedPdf = new(Values.MalformedPdf); + + public static readonly DocVersionsDownloadResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocVersionsDownloadResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocVersionsDownloadResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocVersionsDownloadResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocVersionsDownloadResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocVersionsDownloadResponseCode StaleBase = new(Values.StaleBase); + + public DocVersionsDownloadResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsDownloadResponseCode FromCustom(string value) + { + return new DocVersionsDownloadResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsDownloadResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsDownloadResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsDownloadResponseCode value) => value.Value; + + public static explicit operator DocVersionsDownloadResponseCode(string value) => new(value); + + internal class DocVersionsDownloadResponseCodeSerializer + : JsonConverter + { + public override DocVersionsDownloadResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsDownloadResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsDownloadResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsDownloadResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsDownloadResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsDownloadResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsDownloadResponseName.cs b/src/CloudPDF/Types/DocVersionsDownloadResponseName.cs new file mode 100644 index 0000000..262c221 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsDownloadResponseName.cs @@ -0,0 +1,112 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter(typeof(DocVersionsDownloadResponseName.DocVersionsDownloadResponseNameSerializer))] +[Serializable] +public readonly record struct DocVersionsDownloadResponseName : IStringEnum +{ + public static readonly DocVersionsDownloadResponseName EngineError = new(Values.EngineError); + + public DocVersionsDownloadResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsDownloadResponseName FromCustom(string value) + { + return new DocVersionsDownloadResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsDownloadResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsDownloadResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsDownloadResponseName value) => value.Value; + + public static explicit operator DocVersionsDownloadResponseName(string value) => new(value); + + internal class DocVersionsDownloadResponseNameSerializer + : JsonConverter + { + public override DocVersionsDownloadResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsDownloadResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsDownloadResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsDownloadResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsDownloadResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsDownloadResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsList200Response.cs b/src/CloudPDF/Types/DocVersionsList200Response.cs new file mode 100644 index 0000000..281a53e --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsList200Response.cs @@ -0,0 +1,32 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsList200Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("head")] + public required string Head { get; set; } + + [JsonPropertyName("versions")] + public IEnumerable Versions { get; set; } = + new List(); + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsList200ResponseVersionsItem.cs b/src/CloudPDF/Types/DocVersionsList200ResponseVersionsItem.cs new file mode 100644 index 0000000..b5fc980 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsList200ResponseVersionsItem.cs @@ -0,0 +1,46 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsList200ResponseVersionsItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("sha256")] + public required string Sha256 { get; set; } + + [JsonPropertyName("byteLength")] + public required int ByteLength { get; set; } + + [JsonPropertyName("number")] + public required int Number { get; set; } + + [JsonPropertyName("parentSha256")] + public string? ParentSha256 { get; set; } + + [JsonPropertyName("producer")] + public required DocVersionsList200ResponseVersionsItemProducer Producer { get; set; } + + [JsonPropertyName("signingId")] + public string? SigningId { get; set; } + + [JsonPropertyName("createdAt")] + public required int CreatedAt { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsList200ResponseVersionsItemProducer.cs b/src/CloudPDF/Types/DocVersionsList200ResponseVersionsItemProducer.cs new file mode 100644 index 0000000..79e93ed --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsList200ResponseVersionsItemProducer.cs @@ -0,0 +1,128 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsList200ResponseVersionsItemProducer.DocVersionsList200ResponseVersionsItemProducerSerializer) +)] +[Serializable] +public readonly record struct DocVersionsList200ResponseVersionsItemProducer : IStringEnum +{ + public static readonly DocVersionsList200ResponseVersionsItemProducer Upload = new( + Values.Upload + ); + + public static readonly DocVersionsList200ResponseVersionsItemProducer Signature = new( + Values.Signature + ); + + public DocVersionsList200ResponseVersionsItemProducer(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsList200ResponseVersionsItemProducer FromCustom(string value) + { + return new DocVersionsList200ResponseVersionsItemProducer(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsList200ResponseVersionsItemProducer value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsList200ResponseVersionsItemProducer value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsList200ResponseVersionsItemProducer value) => + value.Value; + + public static explicit operator DocVersionsList200ResponseVersionsItemProducer(string value) => + new(value); + + internal class DocVersionsList200ResponseVersionsItemProducerSerializer + : JsonConverter + { + public override DocVersionsList200ResponseVersionsItemProducer Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsList200ResponseVersionsItemProducer(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsList200ResponseVersionsItemProducer value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsList200ResponseVersionsItemProducer ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsList200ResponseVersionsItemProducer(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsList200ResponseVersionsItemProducer value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Upload = "upload"; + + public const string Signature = "signature"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsList404Response.cs b/src/CloudPDF/Types/DocVersionsList404Response.cs new file mode 100644 index 0000000..68555ac --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsList404Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsList404Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocVersionsList404ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocVersionsList404ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsList404ResponseCode.cs b/src/CloudPDF/Types/DocVersionsList404ResponseCode.cs new file mode 100644 index 0000000..6988663 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsList404ResponseCode.cs @@ -0,0 +1,236 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter(typeof(DocVersionsList404ResponseCode.DocVersionsList404ResponseCodeSerializer))] +[Serializable] +public readonly record struct DocVersionsList404ResponseCode : IStringEnum +{ + public static readonly DocVersionsList404ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocVersionsList404ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocVersionsList404ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocVersionsList404ResponseCode DocOpenFailed = new(Values.DocOpenFailed); + + public static readonly DocVersionsList404ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocVersionsList404ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocVersionsList404ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocVersionsList404ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocVersionsList404ResponseCode Network = new(Values.Network); + + public static readonly DocVersionsList404ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocVersionsList404ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocVersionsList404ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocVersionsList404ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocVersionsList404ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocVersionsList404ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocVersionsList404ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocVersionsList404ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocVersionsList404ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocVersionsList404ResponseCode MalformedPdf = new(Values.MalformedPdf); + + public static readonly DocVersionsList404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocVersionsList404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocVersionsList404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocVersionsList404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocVersionsList404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocVersionsList404ResponseCode StaleBase = new(Values.StaleBase); + + public DocVersionsList404ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsList404ResponseCode FromCustom(string value) + { + return new DocVersionsList404ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsList404ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsList404ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsList404ResponseCode value) => value.Value; + + public static explicit operator DocVersionsList404ResponseCode(string value) => new(value); + + internal class DocVersionsList404ResponseCodeSerializer + : JsonConverter + { + public override DocVersionsList404ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsList404ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsList404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsList404ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsList404ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsList404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsList404ResponseName.cs b/src/CloudPDF/Types/DocVersionsList404ResponseName.cs new file mode 100644 index 0000000..39cc45a --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsList404ResponseName.cs @@ -0,0 +1,112 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter(typeof(DocVersionsList404ResponseName.DocVersionsList404ResponseNameSerializer))] +[Serializable] +public readonly record struct DocVersionsList404ResponseName : IStringEnum +{ + public static readonly DocVersionsList404ResponseName EngineError = new(Values.EngineError); + + public DocVersionsList404ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsList404ResponseName FromCustom(string value) + { + return new DocVersionsList404ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsList404ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsList404ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsList404ResponseName value) => value.Value; + + public static explicit operator DocVersionsList404ResponseName(string value) => new(value); + + internal class DocVersionsList404ResponseNameSerializer + : JsonConverter + { + public override DocVersionsList404ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsList404ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsList404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsList404ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsList404ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsList404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsRevisionResponse.cs b/src/CloudPDF/Types/DocVersionsRevisionResponse.cs new file mode 100644 index 0000000..184f76e --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsRevisionResponse.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsRevisionResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocVersionsRevisionResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocVersionsRevisionResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsRevisionResponseCode.cs b/src/CloudPDF/Types/DocVersionsRevisionResponseCode.cs new file mode 100644 index 0000000..62ed6ec --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsRevisionResponseCode.cs @@ -0,0 +1,238 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter(typeof(DocVersionsRevisionResponseCode.DocVersionsRevisionResponseCodeSerializer))] +[Serializable] +public readonly record struct DocVersionsRevisionResponseCode : IStringEnum +{ + public static readonly DocVersionsRevisionResponseCode Unknown = new(Values.Unknown); + + public static readonly DocVersionsRevisionResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocVersionsRevisionResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocVersionsRevisionResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocVersionsRevisionResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocVersionsRevisionResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocVersionsRevisionResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocVersionsRevisionResponseCode Aborted = new(Values.Aborted); + + public static readonly DocVersionsRevisionResponseCode Network = new(Values.Network); + + public static readonly DocVersionsRevisionResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocVersionsRevisionResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocVersionsRevisionResponseCode NotFound = new(Values.NotFound); + + public static readonly DocVersionsRevisionResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocVersionsRevisionResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocVersionsRevisionResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocVersionsRevisionResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocVersionsRevisionResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocVersionsRevisionResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocVersionsRevisionResponseCode MalformedPdf = new(Values.MalformedPdf); + + public static readonly DocVersionsRevisionResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocVersionsRevisionResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocVersionsRevisionResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocVersionsRevisionResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocVersionsRevisionResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocVersionsRevisionResponseCode StaleBase = new(Values.StaleBase); + + public DocVersionsRevisionResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsRevisionResponseCode FromCustom(string value) + { + return new DocVersionsRevisionResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsRevisionResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsRevisionResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsRevisionResponseCode value) => value.Value; + + public static explicit operator DocVersionsRevisionResponseCode(string value) => new(value); + + internal class DocVersionsRevisionResponseCodeSerializer + : JsonConverter + { + public override DocVersionsRevisionResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsRevisionResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsRevisionResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsRevisionResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsRevisionResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsRevisionResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsRevisionResponseName.cs b/src/CloudPDF/Types/DocVersionsRevisionResponseName.cs new file mode 100644 index 0000000..b6bc5f0 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsRevisionResponseName.cs @@ -0,0 +1,112 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter(typeof(DocVersionsRevisionResponseName.DocVersionsRevisionResponseNameSerializer))] +[Serializable] +public readonly record struct DocVersionsRevisionResponseName : IStringEnum +{ + public static readonly DocVersionsRevisionResponseName EngineError = new(Values.EngineError); + + public DocVersionsRevisionResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsRevisionResponseName FromCustom(string value) + { + return new DocVersionsRevisionResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsRevisionResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsRevisionResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsRevisionResponseName value) => value.Value; + + public static explicit operator DocVersionsRevisionResponseName(string value) => new(value); + + internal class DocVersionsRevisionResponseNameSerializer + : JsonConverter + { + public override DocVersionsRevisionResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsRevisionResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsRevisionResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsRevisionResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsRevisionResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsRevisionResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatureContentsResponse.cs b/src/CloudPDF/Types/DocVersionsSignatureContentsResponse.cs new file mode 100644 index 0000000..e2302ff --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatureContentsResponse.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatureContentsResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocVersionsSignatureContentsResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocVersionsSignatureContentsResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatureContentsResponseCode.cs b/src/CloudPDF/Types/DocVersionsSignatureContentsResponseCode.cs new file mode 100644 index 0000000..ad748cd --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatureContentsResponseCode.cs @@ -0,0 +1,257 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatureContentsResponseCode.DocVersionsSignatureContentsResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatureContentsResponseCode : IStringEnum +{ + public static readonly DocVersionsSignatureContentsResponseCode Unknown = new(Values.Unknown); + + public static readonly DocVersionsSignatureContentsResponseCode InvalidArg = new( + Values.InvalidArg + ); + + public static readonly DocVersionsSignatureContentsResponseCode DocNotOpen = new( + Values.DocNotOpen + ); + + public static readonly DocVersionsSignatureContentsResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocVersionsSignatureContentsResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocVersionsSignatureContentsResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocVersionsSignatureContentsResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocVersionsSignatureContentsResponseCode Aborted = new(Values.Aborted); + + public static readonly DocVersionsSignatureContentsResponseCode Network = new(Values.Network); + + public static readonly DocVersionsSignatureContentsResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocVersionsSignatureContentsResponseCode Forbidden = new( + Values.Forbidden + ); + + public static readonly DocVersionsSignatureContentsResponseCode NotFound = new(Values.NotFound); + + public static readonly DocVersionsSignatureContentsResponseCode WireFormat = new( + Values.WireFormat + ); + + public static readonly DocVersionsSignatureContentsResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocVersionsSignatureContentsResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocVersionsSignatureContentsResponseCode WeakAnnotationSessionConflict = + new(Values.WeakAnnotationSessionConflict); + + public static readonly DocVersionsSignatureContentsResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocVersionsSignatureContentsResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocVersionsSignatureContentsResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocVersionsSignatureContentsResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocVersionsSignatureContentsResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocVersionsSignatureContentsResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocVersionsSignatureContentsResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocVersionsSignatureContentsResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocVersionsSignatureContentsResponseCode StaleBase = new( + Values.StaleBase + ); + + public DocVersionsSignatureContentsResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatureContentsResponseCode FromCustom(string value) + { + return new DocVersionsSignatureContentsResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsSignatureContentsResponseCode value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsSignatureContentsResponseCode value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsSignatureContentsResponseCode value) => + value.Value; + + public static explicit operator DocVersionsSignatureContentsResponseCode(string value) => + new(value); + + internal class DocVersionsSignatureContentsResponseCodeSerializer + : JsonConverter + { + public override DocVersionsSignatureContentsResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatureContentsResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatureContentsResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatureContentsResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatureContentsResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatureContentsResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatureContentsResponseName.cs b/src/CloudPDF/Types/DocVersionsSignatureContentsResponseName.cs new file mode 100644 index 0000000..180feb2 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatureContentsResponseName.cs @@ -0,0 +1,122 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatureContentsResponseName.DocVersionsSignatureContentsResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatureContentsResponseName : IStringEnum +{ + public static readonly DocVersionsSignatureContentsResponseName EngineError = new( + Values.EngineError + ); + + public DocVersionsSignatureContentsResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatureContentsResponseName FromCustom(string value) + { + return new DocVersionsSignatureContentsResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsSignatureContentsResponseName value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsSignatureContentsResponseName value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsSignatureContentsResponseName value) => + value.Value; + + public static explicit operator DocVersionsSignatureContentsResponseName(string value) => + new(value); + + internal class DocVersionsSignatureContentsResponseNameSerializer + : JsonConverter + { + public override DocVersionsSignatureContentsResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatureContentsResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatureContentsResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatureContentsResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatureContentsResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatureContentsResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatureDigestResponse.cs b/src/CloudPDF/Types/DocVersionsSignatureDigestResponse.cs new file mode 100644 index 0000000..4c32be3 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatureDigestResponse.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatureDigestResponse : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocVersionsSignatureDigestResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocVersionsSignatureDigestResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatureDigestResponseCode.cs b/src/CloudPDF/Types/DocVersionsSignatureDigestResponseCode.cs new file mode 100644 index 0000000..f6f44e7 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatureDigestResponseCode.cs @@ -0,0 +1,249 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatureDigestResponseCode.DocVersionsSignatureDigestResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatureDigestResponseCode : IStringEnum +{ + public static readonly DocVersionsSignatureDigestResponseCode Unknown = new(Values.Unknown); + + public static readonly DocVersionsSignatureDigestResponseCode InvalidArg = new( + Values.InvalidArg + ); + + public static readonly DocVersionsSignatureDigestResponseCode DocNotOpen = new( + Values.DocNotOpen + ); + + public static readonly DocVersionsSignatureDigestResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocVersionsSignatureDigestResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocVersionsSignatureDigestResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocVersionsSignatureDigestResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocVersionsSignatureDigestResponseCode Aborted = new(Values.Aborted); + + public static readonly DocVersionsSignatureDigestResponseCode Network = new(Values.Network); + + public static readonly DocVersionsSignatureDigestResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocVersionsSignatureDigestResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocVersionsSignatureDigestResponseCode NotFound = new(Values.NotFound); + + public static readonly DocVersionsSignatureDigestResponseCode WireFormat = new( + Values.WireFormat + ); + + public static readonly DocVersionsSignatureDigestResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocVersionsSignatureDigestResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocVersionsSignatureDigestResponseCode WeakAnnotationSessionConflict = + new(Values.WeakAnnotationSessionConflict); + + public static readonly DocVersionsSignatureDigestResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocVersionsSignatureDigestResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocVersionsSignatureDigestResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocVersionsSignatureDigestResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocVersionsSignatureDigestResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocVersionsSignatureDigestResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocVersionsSignatureDigestResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocVersionsSignatureDigestResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocVersionsSignatureDigestResponseCode StaleBase = new(Values.StaleBase); + + public DocVersionsSignatureDigestResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatureDigestResponseCode FromCustom(string value) + { + return new DocVersionsSignatureDigestResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsSignatureDigestResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsSignatureDigestResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsSignatureDigestResponseCode value) => + value.Value; + + public static explicit operator DocVersionsSignatureDigestResponseCode(string value) => + new(value); + + internal class DocVersionsSignatureDigestResponseCodeSerializer + : JsonConverter + { + public override DocVersionsSignatureDigestResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatureDigestResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatureDigestResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatureDigestResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatureDigestResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatureDigestResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatureDigestResponseName.cs b/src/CloudPDF/Types/DocVersionsSignatureDigestResponseName.cs new file mode 100644 index 0000000..d1b1315 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatureDigestResponseName.cs @@ -0,0 +1,118 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatureDigestResponseName.DocVersionsSignatureDigestResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatureDigestResponseName : IStringEnum +{ + public static readonly DocVersionsSignatureDigestResponseName EngineError = new( + Values.EngineError + ); + + public DocVersionsSignatureDigestResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatureDigestResponseName FromCustom(string value) + { + return new DocVersionsSignatureDigestResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsSignatureDigestResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsSignatureDigestResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsSignatureDigestResponseName value) => + value.Value; + + public static explicit operator DocVersionsSignatureDigestResponseName(string value) => + new(value); + + internal class DocVersionsSignatureDigestResponseNameSerializer + : JsonConverter + { + public override DocVersionsSignatureDigestResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatureDigestResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatureDigestResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatureDigestResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatureDigestResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatureDigestResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200Response.cs b/src/CloudPDF/Types/DocVersionsSignatures200Response.cs new file mode 100644 index 0000000..9e0488b --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200Response.cs @@ -0,0 +1,39 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("chainValid")] + public required bool ChainValid { get; set; } + + [JsonPropertyName("revisions")] + public IEnumerable Revisions { get; set; } = + new List(); + + [JsonPropertyName("signatures")] + public IEnumerable Signatures { get; set; } = + new List(); + + [JsonPropertyName("protection")] + public required DocVersionsSignatures200ResponseProtection Protection { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtection.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtection.cs new file mode 100644 index 0000000..3dcae46 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtection.cs @@ -0,0 +1,41 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseProtection : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("enforced")] + public DocVersionsSignatures200ResponseProtectionEnforced? Enforced { get; set; } + + [JsonPropertyName("judged")] + public DocVersionsSignatures200ResponseProtectionJudged? Judged { get; set; } + + [JsonPropertyName("certification")] + public DocVersionsSignatures200ResponseProtectionCertification? Certification { get; set; } + + [JsonPropertyName("fieldLocks")] + public IEnumerable FieldLocks { get; set; } = + new List(); + + [JsonPropertyName("policyVersion")] + public required int PolicyVersion { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionCertification.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionCertification.cs new file mode 100644 index 0000000..346d1ec --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionCertification.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseProtectionCertification : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("signatureIndex")] + public required int SignatureIndex { get; set; } + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionEnforced.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionEnforced.cs new file mode 100644 index 0000000..7ee6f78 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionEnforced.cs @@ -0,0 +1,140 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatures200ResponseProtectionEnforced.DocVersionsSignatures200ResponseProtectionEnforcedSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatures200ResponseProtectionEnforced : IStringEnum +{ + public static readonly DocVersionsSignatures200ResponseProtectionEnforced None = new( + Values.None + ); + + public static readonly DocVersionsSignatures200ResponseProtectionEnforced Lta = new(Values.Lta); + + public static readonly DocVersionsSignatures200ResponseProtectionEnforced Fill = new( + Values.Fill + ); + + public static readonly DocVersionsSignatures200ResponseProtectionEnforced Annotate = new( + Values.Annotate + ); + + public DocVersionsSignatures200ResponseProtectionEnforced(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatures200ResponseProtectionEnforced FromCustom(string value) + { + return new DocVersionsSignatures200ResponseProtectionEnforced(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsSignatures200ResponseProtectionEnforced value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsSignatures200ResponseProtectionEnforced value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocVersionsSignatures200ResponseProtectionEnforced value + ) => value.Value; + + public static explicit operator DocVersionsSignatures200ResponseProtectionEnforced( + string value + ) => new(value); + + internal class DocVersionsSignatures200ResponseProtectionEnforcedSerializer + : JsonConverter + { + public override DocVersionsSignatures200ResponseProtectionEnforced Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatures200ResponseProtectionEnforced(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseProtectionEnforced value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatures200ResponseProtectionEnforced ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatures200ResponseProtectionEnforced(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseProtectionEnforced value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string None = "none"; + + public const string Lta = "lta"; + + public const string Fill = "fill"; + + public const string Annotate = "annotate"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItem.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItem.cs new file mode 100644 index 0000000..750d151 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItem.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseProtectionFieldLocksItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("signatureIndex")] + public required int SignatureIndex { get; set; } + + [JsonPropertyName("source")] + public required DocVersionsSignatures200ResponseProtectionFieldLocksItemSource Source { get; set; } + + [JsonPropertyName("spec")] + public DocVersionsSignatures200ResponseProtectionFieldLocksItemSpec? Spec { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSource.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSource.cs new file mode 100644 index 0000000..221f9ed --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSource.cs @@ -0,0 +1,131 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatures200ResponseProtectionFieldLocksItemSource.DocVersionsSignatures200ResponseProtectionFieldLocksItemSourceSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatures200ResponseProtectionFieldLocksItemSource + : IStringEnum +{ + public static readonly DocVersionsSignatures200ResponseProtectionFieldLocksItemSource Fieldmdp = + new(Values.Fieldmdp); + + public static readonly DocVersionsSignatures200ResponseProtectionFieldLocksItemSource Lock = + new(Values.Lock); + + public DocVersionsSignatures200ResponseProtectionFieldLocksItemSource(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatures200ResponseProtectionFieldLocksItemSource FromCustom( + string value + ) + { + return new DocVersionsSignatures200ResponseProtectionFieldLocksItemSource(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsSignatures200ResponseProtectionFieldLocksItemSource value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsSignatures200ResponseProtectionFieldLocksItemSource value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocVersionsSignatures200ResponseProtectionFieldLocksItemSource value + ) => value.Value; + + public static explicit operator DocVersionsSignatures200ResponseProtectionFieldLocksItemSource( + string value + ) => new(value); + + internal class DocVersionsSignatures200ResponseProtectionFieldLocksItemSourceSerializer + : JsonConverter + { + public override DocVersionsSignatures200ResponseProtectionFieldLocksItemSource Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatures200ResponseProtectionFieldLocksItemSource(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseProtectionFieldLocksItemSource value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatures200ResponseProtectionFieldLocksItemSource ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatures200ResponseProtectionFieldLocksItemSource(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseProtectionFieldLocksItemSource value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Fieldmdp = "fieldmdp"; + + public const string Lock = "lock"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSpec.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSpec.cs new file mode 100644 index 0000000..c075ad6 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSpec.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseProtectionFieldLocksItemSpec : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("action")] + public required DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction Action { get; set; } + + [JsonPropertyName("fields")] + public IEnumerable Fields { get; set; } = new List(); + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction.cs new file mode 100644 index 0000000..6ccc7b6 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction.cs @@ -0,0 +1,140 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction.DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecActionSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction + : IStringEnum +{ + public static readonly DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction All = + new(Values.All); + + public static readonly DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction Include = + new(Values.Include); + + public static readonly DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction Exclude = + new(Values.Exclude); + + public DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction FromCustom( + string value + ) + { + return new DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction value + ) => value.Value; + + public static explicit operator DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction( + string value + ) => new(value); + + internal class DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecActionSerializer + : JsonConverter + { + public override DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction( + stringValue + ); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction( + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string All = "all"; + + public const string Include = "include"; + + public const string Exclude = "exclude"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionJudged.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionJudged.cs new file mode 100644 index 0000000..7b4895a --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseProtectionJudged.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatures200ResponseProtectionJudged.DocVersionsSignatures200ResponseProtectionJudgedSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatures200ResponseProtectionJudged : IStringEnum +{ + public static readonly DocVersionsSignatures200ResponseProtectionJudged None = new(Values.None); + + public static readonly DocVersionsSignatures200ResponseProtectionJudged Lta = new(Values.Lta); + + public static readonly DocVersionsSignatures200ResponseProtectionJudged Fill = new(Values.Fill); + + public static readonly DocVersionsSignatures200ResponseProtectionJudged Annotate = new( + Values.Annotate + ); + + public DocVersionsSignatures200ResponseProtectionJudged(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatures200ResponseProtectionJudged FromCustom(string value) + { + return new DocVersionsSignatures200ResponseProtectionJudged(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsSignatures200ResponseProtectionJudged value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsSignatures200ResponseProtectionJudged value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocVersionsSignatures200ResponseProtectionJudged value + ) => value.Value; + + public static explicit operator DocVersionsSignatures200ResponseProtectionJudged( + string value + ) => new(value); + + internal class DocVersionsSignatures200ResponseProtectionJudgedSerializer + : JsonConverter + { + public override DocVersionsSignatures200ResponseProtectionJudged Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatures200ResponseProtectionJudged(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseProtectionJudged value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatures200ResponseProtectionJudged ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatures200ResponseProtectionJudged(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseProtectionJudged value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string None = "none"; + + public const string Lta = "lta"; + + public const string Fill = "fill"; + + public const string Annotate = "annotate"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseRevisionsItem.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseRevisionsItem.cs new file mode 100644 index 0000000..7b1b61a --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseRevisionsItem.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseRevisionsItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("index")] + public required int Index { get; set; } + + [JsonPropertyName("end")] + public required int End { get; set; } + + [JsonPropertyName("xrefOffset")] + public required int XrefOffset { get; set; } + + [JsonPropertyName("signatureIndex")] + public int? SignatureIndex { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItem.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItem.cs new file mode 100644 index 0000000..78d7cba --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItem.cs @@ -0,0 +1,79 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseSignaturesItem : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("index")] + public required int Index { get; set; } + + [JsonPropertyName("field")] + public required DocVersionsSignatures200ResponseSignaturesItemField Field { get; set; } + + [JsonPropertyName("fieldName")] + public required string FieldName { get; set; } + + [JsonPropertyName("widget")] + public DocVersionsSignatures200ResponseSignaturesItemWidget? Widget { get; set; } + + [JsonPropertyName("signed")] + public required bool Signed { get; set; } + + [JsonPropertyName("kind")] + public required DocVersionsSignatures200ResponseSignaturesItemKind Kind { get; set; } + + [JsonPropertyName("filter")] + public string? Filter { get; set; } + + [JsonPropertyName("subFilter")] + public string? SubFilter { get; set; } + + [JsonPropertyName("byteRange")] + public IEnumerable? ByteRange { get; set; } + + [JsonPropertyName("contentsSize")] + public required int ContentsSize { get; set; } + + [JsonPropertyName("coverage")] + public DocVersionsSignatures200ResponseSignaturesItemCoverage? Coverage { get; set; } + + [JsonPropertyName("revisionIndex")] + public int? RevisionIndex { get; set; } + + [JsonPropertyName("signer")] + public required DocVersionsSignatures200ResponseSignaturesItemSigner Signer { get; set; } + + [JsonPropertyName("docMdp")] + public double? DocMdp { get; set; } + + [JsonPropertyName("catalogCertification")] + public required bool CatalogCertification { get; set; } + + [JsonPropertyName("fieldMdp")] + public DocVersionsSignatures200ResponseSignaturesItemFieldMdp? FieldMdp { get; set; } + + [JsonPropertyName("lock")] + public DocVersionsSignatures200ResponseSignaturesItemLock? Lock { get; set; } + + [JsonPropertyName("seedValue")] + public DocVersionsSignatures200ResponseSignaturesItemSeedValue? SeedValue { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemCoverage.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemCoverage.cs new file mode 100644 index 0000000..d6ae79b --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemCoverage.cs @@ -0,0 +1,135 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatures200ResponseSignaturesItemCoverage.DocVersionsSignatures200ResponseSignaturesItemCoverageSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatures200ResponseSignaturesItemCoverage : IStringEnum +{ + public static readonly DocVersionsSignatures200ResponseSignaturesItemCoverage WholeRevision = + new(Values.WholeRevision); + + public static readonly DocVersionsSignatures200ResponseSignaturesItemCoverage Partial = new( + Values.Partial + ); + + public static readonly DocVersionsSignatures200ResponseSignaturesItemCoverage Malformed = new( + Values.Malformed + ); + + public DocVersionsSignatures200ResponseSignaturesItemCoverage(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatures200ResponseSignaturesItemCoverage FromCustom(string value) + { + return new DocVersionsSignatures200ResponseSignaturesItemCoverage(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsSignatures200ResponseSignaturesItemCoverage value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsSignatures200ResponseSignaturesItemCoverage value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocVersionsSignatures200ResponseSignaturesItemCoverage value + ) => value.Value; + + public static explicit operator DocVersionsSignatures200ResponseSignaturesItemCoverage( + string value + ) => new(value); + + internal class DocVersionsSignatures200ResponseSignaturesItemCoverageSerializer + : JsonConverter + { + public override DocVersionsSignatures200ResponseSignaturesItemCoverage Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatures200ResponseSignaturesItemCoverage(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseSignaturesItemCoverage value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatures200ResponseSignaturesItemCoverage ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatures200ResponseSignaturesItemCoverage(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseSignaturesItemCoverage value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string WholeRevision = "whole-revision"; + + public const string Partial = "partial"; + + public const string Malformed = "malformed"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemField.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemField.cs new file mode 100644 index 0000000..cca698f --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemField.cs @@ -0,0 +1,310 @@ +// ReSharper disable NullableWarningSuppressionIsUsed +// ReSharper disable InconsistentNaming + +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Nodes; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter(typeof(DocVersionsSignatures200ResponseSignaturesItemField.JsonConverter))] +[Serializable] +public record DocVersionsSignatures200ResponseSignaturesItemField +{ + internal DocVersionsSignatures200ResponseSignaturesItemField(string type, object? value) + { + Kind = type; + Value = value; + } + + /// + /// Create an instance of DocVersionsSignatures200ResponseSignaturesItemField with . + /// + public DocVersionsSignatures200ResponseSignaturesItemField( + DocVersionsSignatures200ResponseSignaturesItemField.ObjectNumber value + ) + { + Kind = "objectNumber"; + Value = value.Value; + } + + /// + /// Create an instance of DocVersionsSignatures200ResponseSignaturesItemField with . + /// + public DocVersionsSignatures200ResponseSignaturesItemField( + DocVersionsSignatures200ResponseSignaturesItemField.Fqn value + ) + { + Kind = "fqn"; + Value = value.Value; + } + + /// + /// Discriminant value + /// + [JsonPropertyName("kind")] + public string Kind { get; internal set; } + + /// + /// Discriminated union value + /// + public object? Value { get; internal set; } + + /// + /// Returns true if is "objectNumber" + /// + public bool IsObjectNumber => Kind == "objectNumber"; + + /// + /// Returns true if is "fqn" + /// + public bool IsFqn => Kind == "fqn"; + + /// + /// Returns the value as a if is 'objectNumber', otherwise throws an exception. + /// + /// Thrown when is not 'objectNumber'. + public CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber AsObjectNumber() => + IsObjectNumber + ? (CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber)Value! + : throw new global::System.Exception( + "DocVersionsSignatures200ResponseSignaturesItemField.Kind is not 'objectNumber'" + ); + + /// + /// Returns the value as a if is 'fqn', otherwise throws an exception. + /// + /// Thrown when is not 'fqn'. + public CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldFqn AsFqn() => + IsFqn + ? (CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldFqn)Value! + : throw new global::System.Exception( + "DocVersionsSignatures200ResponseSignaturesItemField.Kind is not 'fqn'" + ); + + public T Match( + Func< + CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber, + T + > onObjectNumber, + Func onFqn, + Func onUnknown_ + ) + { + return Kind switch + { + "objectNumber" => onObjectNumber(AsObjectNumber()), + "fqn" => onFqn(AsFqn()), + _ => onUnknown_(Kind, Value), + }; + } + + public void Visit( + Action onObjectNumber, + Action onFqn, + Action onUnknown_ + ) + { + switch (Kind) + { + case "objectNumber": + onObjectNumber(AsObjectNumber()); + break; + case "fqn": + onFqn(AsFqn()); + break; + default: + onUnknown_(Kind, Value); + break; + } + } + + /// + /// Attempts to cast the value to a and returns true if successful. + /// + public bool TryAsObjectNumber( + out CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber? value + ) + { + if (Kind == "objectNumber") + { + value = (CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber) + Value!; + return true; + } + value = null; + return false; + } + + /// + /// Attempts to cast the value to a and returns true if successful. + /// + public bool TryAsFqn(out CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldFqn? value) + { + if (Kind == "fqn") + { + value = (CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldFqn)Value!; + return true; + } + value = null; + return false; + } + + public override string ToString() => JsonUtils.Serialize(this); + + public static implicit operator DocVersionsSignatures200ResponseSignaturesItemField( + DocVersionsSignatures200ResponseSignaturesItemField.ObjectNumber value + ) => new(value); + + public static implicit operator DocVersionsSignatures200ResponseSignaturesItemField( + DocVersionsSignatures200ResponseSignaturesItemField.Fqn value + ) => new(value); + + [Serializable] + internal sealed class JsonConverter + : JsonConverter + { + public override bool CanConvert(global::System.Type typeToConvert) => + typeof(DocVersionsSignatures200ResponseSignaturesItemField).IsAssignableFrom( + typeToConvert + ); + + public override DocVersionsSignatures200ResponseSignaturesItemField Read( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var json = JsonElement.ParseValue(ref reader); + if (!json.TryGetProperty("kind", out var discriminatorElement)) + { + throw new JsonException("Missing discriminator property 'kind'"); + } + if (discriminatorElement.ValueKind != JsonValueKind.String) + { + if (discriminatorElement.ValueKind == JsonValueKind.Null) + { + throw new JsonException("Discriminator property 'kind' is null"); + } + + throw new JsonException( + $"Discriminator property 'kind' is not a string, instead is {discriminatorElement.ToString()}" + ); + } + + var discriminator = + discriminatorElement.GetString() + ?? throw new JsonException("Discriminator property 'kind' is null"); + + // Strip the discriminant property to prevent it from leaking into AdditionalProperties + var jsonObject = System.Text.Json.Nodes.JsonObject.Create(json); + jsonObject?.Remove("kind"); + var jsonWithoutDiscriminator = + jsonObject != null ? JsonSerializer.SerializeToElement(jsonObject, options) : json; + + var value = discriminator switch + { + "objectNumber" => + jsonWithoutDiscriminator.Deserialize( + options + ) + ?? throw new JsonException( + "Failed to deserialize CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber" + ), + "fqn" => + jsonWithoutDiscriminator.Deserialize( + options + ) + ?? throw new JsonException( + "Failed to deserialize CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldFqn" + ), + _ => json.Deserialize(options), + }; + return new DocVersionsSignatures200ResponseSignaturesItemField(discriminator, value); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseSignaturesItemField value, + JsonSerializerOptions options + ) + { + JsonNode json = + value.Kind switch + { + "objectNumber" => JsonSerializer.SerializeToNode(value.Value, options), + "fqn" => JsonSerializer.SerializeToNode(value.Value, options), + _ => JsonSerializer.SerializeToNode(value.Value, options), + } ?? new JsonObject(); + json["kind"] = value.Kind; + json.WriteTo(writer, options); + } + + public override DocVersionsSignatures200ResponseSignaturesItemField ReadAsPropertyName( + ref Utf8JsonReader reader, + global::System.Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new JsonException("The JSON property name could not be read as a string."); + return new DocVersionsSignatures200ResponseSignaturesItemField( + stringValue, + stringValue + ); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseSignaturesItemField value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Kind); + } + } + + /// + /// Discriminated union type for objectNumber + /// + [Serializable] + public struct ObjectNumber + { + public ObjectNumber( + CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber value + ) + { + Value = value; + } + + internal CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber Value { get; set; } + + public override string ToString() => Value.ToString() ?? "null"; + + public static implicit operator DocVersionsSignatures200ResponseSignaturesItemField.ObjectNumber( + CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber value + ) => new(value); + } + + /// + /// Discriminated union type for fqn + /// + [Serializable] + public struct Fqn + { + public Fqn(CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldFqn value) + { + Value = value; + } + + internal CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldFqn Value { get; set; } + + public override string ToString() => Value.ToString() ?? "null"; + + public static implicit operator DocVersionsSignatures200ResponseSignaturesItemField.Fqn( + CloudPDF.DocVersionsSignatures200ResponseSignaturesItemFieldFqn value + ) => new(value); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldFqn.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldFqn.cs new file mode 100644 index 0000000..438166d --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldFqn.cs @@ -0,0 +1,28 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseSignaturesItemFieldFqn : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required string Name { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldMdp.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldMdp.cs new file mode 100644 index 0000000..4cd1be9 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldMdp.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseSignaturesItemFieldMdp : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("action")] + public required DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction Action { get; set; } + + [JsonPropertyName("fields")] + public IEnumerable Fields { get; set; } = new List(); + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction.cs new file mode 100644 index 0000000..8d724da --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction.cs @@ -0,0 +1,137 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction.DocVersionsSignatures200ResponseSignaturesItemFieldMdpActionSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction + : IStringEnum +{ + public static readonly DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction All = new( + Values.All + ); + + public static readonly DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction Include = + new(Values.Include); + + public static readonly DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction Exclude = + new(Values.Exclude); + + public DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction FromCustom( + string value + ) + { + return new DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction value + ) => value.Value; + + public static explicit operator DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction( + string value + ) => new(value); + + internal class DocVersionsSignatures200ResponseSignaturesItemFieldMdpActionSerializer + : JsonConverter + { + public override DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string All = "all"; + + public const string Include = "include"; + + public const string Exclude = "exclude"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber.cs new file mode 100644 index 0000000..32e2ff1 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber.cs @@ -0,0 +1,28 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("fieldObjectNumber")] + public required int FieldObjectNumber { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemKind.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemKind.cs new file mode 100644 index 0000000..e8d48eb --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemKind.cs @@ -0,0 +1,130 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatures200ResponseSignaturesItemKind.DocVersionsSignatures200ResponseSignaturesItemKindSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatures200ResponseSignaturesItemKind : IStringEnum +{ + public static readonly DocVersionsSignatures200ResponseSignaturesItemKind Signature = new( + Values.Signature + ); + + public static readonly DocVersionsSignatures200ResponseSignaturesItemKind Timestamp = new( + Values.Timestamp + ); + + public DocVersionsSignatures200ResponseSignaturesItemKind(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatures200ResponseSignaturesItemKind FromCustom(string value) + { + return new DocVersionsSignatures200ResponseSignaturesItemKind(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsSignatures200ResponseSignaturesItemKind value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsSignatures200ResponseSignaturesItemKind value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocVersionsSignatures200ResponseSignaturesItemKind value + ) => value.Value; + + public static explicit operator DocVersionsSignatures200ResponseSignaturesItemKind( + string value + ) => new(value); + + internal class DocVersionsSignatures200ResponseSignaturesItemKindSerializer + : JsonConverter + { + public override DocVersionsSignatures200ResponseSignaturesItemKind Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatures200ResponseSignaturesItemKind(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseSignaturesItemKind value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatures200ResponseSignaturesItemKind ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatures200ResponseSignaturesItemKind(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseSignaturesItemKind value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Signature = "signature"; + + public const string Timestamp = "timestamp"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemLock.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemLock.cs new file mode 100644 index 0000000..88b68f3 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemLock.cs @@ -0,0 +1,34 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseSignaturesItemLock : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("action")] + public required DocVersionsSignatures200ResponseSignaturesItemLockAction Action { get; set; } + + [JsonPropertyName("fields")] + public IEnumerable Fields { get; set; } = new List(); + + [JsonPropertyName("permission")] + public double? Permission { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemLockAction.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemLockAction.cs new file mode 100644 index 0000000..b674bcc --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemLockAction.cs @@ -0,0 +1,136 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatures200ResponseSignaturesItemLockAction.DocVersionsSignatures200ResponseSignaturesItemLockActionSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatures200ResponseSignaturesItemLockAction : IStringEnum +{ + public static readonly DocVersionsSignatures200ResponseSignaturesItemLockAction All = new( + Values.All + ); + + public static readonly DocVersionsSignatures200ResponseSignaturesItemLockAction Include = new( + Values.Include + ); + + public static readonly DocVersionsSignatures200ResponseSignaturesItemLockAction Exclude = new( + Values.Exclude + ); + + public DocVersionsSignatures200ResponseSignaturesItemLockAction(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatures200ResponseSignaturesItemLockAction FromCustom(string value) + { + return new DocVersionsSignatures200ResponseSignaturesItemLockAction(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==( + DocVersionsSignatures200ResponseSignaturesItemLockAction value1, + string value2 + ) => value1.Value.Equals(value2); + + public static bool operator !=( + DocVersionsSignatures200ResponseSignaturesItemLockAction value1, + string value2 + ) => !value1.Value.Equals(value2); + + public static explicit operator string( + DocVersionsSignatures200ResponseSignaturesItemLockAction value + ) => value.Value; + + public static explicit operator DocVersionsSignatures200ResponseSignaturesItemLockAction( + string value + ) => new(value); + + internal class DocVersionsSignatures200ResponseSignaturesItemLockActionSerializer + : JsonConverter + { + public override DocVersionsSignatures200ResponseSignaturesItemLockAction Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatures200ResponseSignaturesItemLockAction(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseSignaturesItemLockAction value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatures200ResponseSignaturesItemLockAction ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatures200ResponseSignaturesItemLockAction(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatures200ResponseSignaturesItemLockAction value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string All = "all"; + + public const string Include = "include"; + + public const string Exclude = "exclude"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemSeedValue.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemSeedValue.cs new file mode 100644 index 0000000..e9505ba --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemSeedValue.cs @@ -0,0 +1,52 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseSignaturesItemSeedValue : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("requiredFlags")] + public required int RequiredFlags { get; set; } + + [JsonPropertyName("presentFlags")] + public required int PresentFlags { get; set; } + + [JsonPropertyName("version")] + public int? Version { get; set; } + + [JsonPropertyName("mdp")] + public double? Mdp { get; set; } + + [JsonPropertyName("filter")] + public string? Filter { get; set; } + + [JsonPropertyName("subFilters")] + public IEnumerable SubFilters { get; set; } = new List(); + + [JsonPropertyName("digestMethods")] + public IEnumerable DigestMethods { get; set; } = new List(); + + [JsonPropertyName("reasons")] + public IEnumerable Reasons { get; set; } = new List(); + + [JsonPropertyName("unsupportedRequired")] + public required bool UnsupportedRequired { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemSigner.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemSigner.cs new file mode 100644 index 0000000..b00b21b --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemSigner.cs @@ -0,0 +1,40 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseSignaturesItemSigner : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonPropertyName("reason")] + public string? Reason { get; set; } + + [JsonPropertyName("location")] + public string? Location { get; set; } + + [JsonPropertyName("contactInfo")] + public string? ContactInfo { get; set; } + + [JsonPropertyName("claimedTime")] + public string? ClaimedTime { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemWidget.cs b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemWidget.cs new file mode 100644 index 0000000..6dbbf1c --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures200ResponseSignaturesItemWidget.cs @@ -0,0 +1,31 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures200ResponseSignaturesItemWidget : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("annotObjectNumber")] + public required int AnnotObjectNumber { get; set; } + + [JsonPropertyName("pageObjectNumber")] + public required int PageObjectNumber { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures404Response.cs b/src/CloudPDF/Types/DocVersionsSignatures404Response.cs new file mode 100644 index 0000000..e41998b --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures404Response.cs @@ -0,0 +1,37 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[Serializable] +public record DocVersionsSignatures404Response : IJsonOnDeserialized +{ + [JsonExtensionData] + private readonly IDictionary _extensionData = + new Dictionary(); + + [JsonPropertyName("name")] + public required DocVersionsSignatures404ResponseName Name { get; set; } + + [JsonPropertyName("code")] + public required DocVersionsSignatures404ResponseCode Code { get; set; } + + [JsonPropertyName("message")] + public required string Message { get; set; } + + [JsonPropertyName("details")] + public Dictionary? Details { get; set; } + + [JsonIgnore] + public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new(); + + void IJsonOnDeserialized.OnDeserialized() => + AdditionalProperties.CopyFromExtensionData(_extensionData); + + /// + public override string ToString() + { + return JsonUtils.Serialize(this); + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures404ResponseCode.cs b/src/CloudPDF/Types/DocVersionsSignatures404ResponseCode.cs new file mode 100644 index 0000000..c877cf8 --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures404ResponseCode.cs @@ -0,0 +1,244 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatures404ResponseCode.DocVersionsSignatures404ResponseCodeSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatures404ResponseCode : IStringEnum +{ + public static readonly DocVersionsSignatures404ResponseCode Unknown = new(Values.Unknown); + + public static readonly DocVersionsSignatures404ResponseCode InvalidArg = new(Values.InvalidArg); + + public static readonly DocVersionsSignatures404ResponseCode DocNotOpen = new(Values.DocNotOpen); + + public static readonly DocVersionsSignatures404ResponseCode DocOpenFailed = new( + Values.DocOpenFailed + ); + + public static readonly DocVersionsSignatures404ResponseCode DocPasswordRequired = new( + Values.DocPasswordRequired + ); + + public static readonly DocVersionsSignatures404ResponseCode DocPasswordIncorrect = new( + Values.DocPasswordIncorrect + ); + + public static readonly DocVersionsSignatures404ResponseCode SharePasswordRequired = new( + Values.SharePasswordRequired + ); + + public static readonly DocVersionsSignatures404ResponseCode Aborted = new(Values.Aborted); + + public static readonly DocVersionsSignatures404ResponseCode Network = new(Values.Network); + + public static readonly DocVersionsSignatures404ResponseCode Unauthenticated = new( + Values.Unauthenticated + ); + + public static readonly DocVersionsSignatures404ResponseCode Forbidden = new(Values.Forbidden); + + public static readonly DocVersionsSignatures404ResponseCode NotFound = new(Values.NotFound); + + public static readonly DocVersionsSignatures404ResponseCode WireFormat = new(Values.WireFormat); + + public static readonly DocVersionsSignatures404ResponseCode RuntimeUnavailable = new( + Values.RuntimeUnavailable + ); + + public static readonly DocVersionsSignatures404ResponseCode InvalidReference = new( + Values.InvalidReference + ); + + public static readonly DocVersionsSignatures404ResponseCode WeakAnnotationSessionConflict = new( + Values.WeakAnnotationSessionConflict + ); + + public static readonly DocVersionsSignatures404ResponseCode LayerVersionConflict = new( + Values.LayerVersionConflict + ); + + public static readonly DocVersionsSignatures404ResponseCode NotImplemented = new( + Values.NotImplemented + ); + + public static readonly DocVersionsSignatures404ResponseCode MalformedPdf = new( + Values.MalformedPdf + ); + + public static readonly DocVersionsSignatures404ResponseCode SigningPending = new( + Values.SigningPending + ); + + public static readonly DocVersionsSignatures404ResponseCode SigningExpired = new( + Values.SigningExpired + ); + + public static readonly DocVersionsSignatures404ResponseCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly DocVersionsSignatures404ResponseCode SignatureRefused = new( + Values.SignatureRefused + ); + + public static readonly DocVersionsSignatures404ResponseCode ProtectedDocument = new( + Values.ProtectedDocument + ); + + public static readonly DocVersionsSignatures404ResponseCode StaleBase = new(Values.StaleBase); + + public DocVersionsSignatures404ResponseCode(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatures404ResponseCode FromCustom(string value) + { + return new DocVersionsSignatures404ResponseCode(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsSignatures404ResponseCode value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsSignatures404ResponseCode value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsSignatures404ResponseCode value) => + value.Value; + + public static explicit operator DocVersionsSignatures404ResponseCode(string value) => + new(value); + + internal class DocVersionsSignatures404ResponseCodeSerializer + : JsonConverter + { + public override DocVersionsSignatures404ResponseCode Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatures404ResponseCode(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatures404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatures404ResponseCode ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatures404ResponseCode(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatures404ResponseCode value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string Unknown = "Unknown"; + + public const string InvalidArg = "InvalidArg"; + + public const string DocNotOpen = "DocNotOpen"; + + public const string DocOpenFailed = "DocOpenFailed"; + + public const string DocPasswordRequired = "DocPasswordRequired"; + + public const string DocPasswordIncorrect = "DocPasswordIncorrect"; + + public const string SharePasswordRequired = "SharePasswordRequired"; + + public const string Aborted = "Aborted"; + + public const string Network = "Network"; + + public const string Unauthenticated = "Unauthenticated"; + + public const string Forbidden = "Forbidden"; + + public const string NotFound = "NotFound"; + + public const string WireFormat = "WireFormat"; + + public const string RuntimeUnavailable = "RuntimeUnavailable"; + + public const string InvalidReference = "InvalidReference"; + + public const string WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; + + public const string LayerVersionConflict = "LayerVersionConflict"; + + public const string NotImplemented = "NotImplemented"; + + public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; + } +} diff --git a/src/CloudPDF/Types/DocVersionsSignatures404ResponseName.cs b/src/CloudPDF/Types/DocVersionsSignatures404ResponseName.cs new file mode 100644 index 0000000..905eaba --- /dev/null +++ b/src/CloudPDF/Types/DocVersionsSignatures404ResponseName.cs @@ -0,0 +1,118 @@ +using CloudPDF.Core; +using global::System.Text.Json; +using global::System.Text.Json.Serialization; + +namespace CloudPDF; + +[JsonConverter( + typeof(DocVersionsSignatures404ResponseName.DocVersionsSignatures404ResponseNameSerializer) +)] +[Serializable] +public readonly record struct DocVersionsSignatures404ResponseName : IStringEnum +{ + public static readonly DocVersionsSignatures404ResponseName EngineError = new( + Values.EngineError + ); + + public DocVersionsSignatures404ResponseName(string value) + { + Value = value; + } + + /// + /// The string value of the enum. + /// + public string Value { get; } + + /// + /// Create a string enum with the given value. + /// + public static DocVersionsSignatures404ResponseName FromCustom(string value) + { + return new DocVersionsSignatures404ResponseName(value); + } + + public bool Equals(string? other) + { + return Value.Equals(other); + } + + /// + /// Returns the string value of the enum. + /// + public override string ToString() + { + return Value; + } + + public static bool operator ==(DocVersionsSignatures404ResponseName value1, string value2) => + value1.Value.Equals(value2); + + public static bool operator !=(DocVersionsSignatures404ResponseName value1, string value2) => + !value1.Value.Equals(value2); + + public static explicit operator string(DocVersionsSignatures404ResponseName value) => + value.Value; + + public static explicit operator DocVersionsSignatures404ResponseName(string value) => + new(value); + + internal class DocVersionsSignatures404ResponseNameSerializer + : JsonConverter + { + public override DocVersionsSignatures404ResponseName Read( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON value could not be read as a string." + ); + return new DocVersionsSignatures404ResponseName(stringValue); + } + + public override void Write( + Utf8JsonWriter writer, + DocVersionsSignatures404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WriteStringValue(value.Value); + } + + public override DocVersionsSignatures404ResponseName ReadAsPropertyName( + ref Utf8JsonReader reader, + Type typeToConvert, + JsonSerializerOptions options + ) + { + var stringValue = + reader.GetString() + ?? throw new global::System.Exception( + "The JSON property name could not be read as a string." + ); + return new DocVersionsSignatures404ResponseName(stringValue); + } + + public override void WriteAsPropertyName( + Utf8JsonWriter writer, + DocVersionsSignatures404ResponseName value, + JsonSerializerOptions options + ) + { + writer.WritePropertyName(value.Value); + } + } + + /// + /// Constant strings for enum values + /// + [Serializable] + public static class Values + { + public const string EngineError = "EngineError"; + } +} diff --git a/src/CloudPDF/Types/EngineErrorPayloadCode.cs b/src/CloudPDF/Types/EngineErrorPayloadCode.cs index b222462..2830cbb 100644 --- a/src/CloudPDF/Types/EngineErrorPayloadCode.cs +++ b/src/CloudPDF/Types/EngineErrorPayloadCode.cs @@ -58,6 +58,20 @@ namespace CloudPDF; public static readonly EngineErrorPayloadCode MalformedPdf = new(Values.MalformedPdf); + public static readonly EngineErrorPayloadCode SigningPending = new(Values.SigningPending); + + public static readonly EngineErrorPayloadCode SigningExpired = new(Values.SigningExpired); + + public static readonly EngineErrorPayloadCode SigningVersionMismatch = new( + Values.SigningVersionMismatch + ); + + public static readonly EngineErrorPayloadCode SignatureRefused = new(Values.SignatureRefused); + + public static readonly EngineErrorPayloadCode ProtectedDocument = new(Values.ProtectedDocument); + + public static readonly EngineErrorPayloadCode StaleBase = new(Values.StaleBase); + public EngineErrorPayloadCode(string value) { Value = value; @@ -191,5 +205,17 @@ public static class Values public const string NotImplemented = "NotImplemented"; public const string MalformedPdf = "MalformedPdf"; + + public const string SigningPending = "SigningPending"; + + public const string SigningExpired = "SigningExpired"; + + public const string SigningVersionMismatch = "SigningVersionMismatch"; + + public const string SignatureRefused = "SignatureRefused"; + + public const string ProtectedDocument = "ProtectedDocument"; + + public const string StaleBase = "StaleBase"; } }