From e18bde551fbe9fc347594eb1a6e1d8cee0ab79aa Mon Sep 17 00:00:00 2001 From: cloudpdf-sdk-bot Date: Sun, 23 Aug 2026 21:39:20 +0000 Subject: [PATCH] chore: generate CloudPDF Python SDK 3.0.0a7 --- .fern/metadata.json | 4 ++-- cloudpdf-generation.json | 8 +++---- pyproject.toml | 2 +- reference.md | 12 +++++----- src/cloudpdf/core/client_wrapper.py | 4 ++-- src/cloudpdf/documents/client.py | 12 ++++++++++ src/cloudpdf/documents/raw_client.py | 12 ++++++++++ .../documents_import_from_request_expected.py | 19 +++++++++++++-- .../documents_import_from_request_source.py | 8 +++++++ ...s_import_from_request_source_connection.py | 23 ++++++++++++++++--- ...ocuments_import_from_request_source_url.py | 9 +++++++- 11 files changed, 92 insertions(+), 21 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 3588711..c7c48ac 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -7,9 +7,9 @@ "client_class_name": "CloudPDFClient", "environment_class_name": "CloudPDFEnvironment" }, - "originGitCommit": "32635f40577b214f6a6b3189a2271425c3a574fd", + "originGitCommit": "1345fb7a45ee660a352774d29decce25cb54b8ea", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0a6", + "requestedVersion": "3.0.0a7", "ciProvider": "github" } \ No newline at end of file diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 5129077..e7289dd 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "python", - "canonicalVersion": "3.0.0-next.6", - "sdkVersion": "3.0.0a6", + "canonicalVersion": "3.0.0-next.7", + "sdkVersion": "3.0.0a7", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "b3e236a932673e27e05825352e1bc3675369d7505040bf7d7760e542aae8d38d", - "gitCommit": "32635f40577b214f6a6b3189a2271425c3a574fd", + "openapiSha256": "f6fc610bfd193f278a7e8ec063d9e96b8fef86bdec7ade5e7bc4b19879673147", + "gitCommit": "1345fb7a45ee660a352774d29decce25cb54b8ea", "gitCommitIsDirty": false }, "fern": { diff --git a/pyproject.toml b/pyproject.toml index 7e16fc0..8d7eef2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] [tool.poetry] name = "cloudpdf" -version = "3.0.0a6" +version = "3.0.0a7" description = "The official Python SDK for the CloudPDF API." readme = "README.md" authors = ["CloudPDF "] diff --git a/reference.md b/reference.md index 8aa1755..e6a4a4d 100644 --- a/reference.md +++ b/reference.md @@ -2051,7 +2051,7 @@ client.documents.import_from(
-**source:** `DocumentsImportFromRequestSource` +**source:** `DocumentsImportFromRequestSource` — Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file.
@@ -2059,7 +2059,7 @@ client.documents.import_from(
-**expected:** `typing.Optional[DocumentsImportFromRequestExpected]` +**expected:** `typing.Optional[DocumentsImportFromRequestExpected]` — Integrity pins, enforced when present. When absent, the server-observed values become authoritative.
@@ -2075,7 +2075,7 @@ client.documents.import_from(
-**idempotency_key:** `typing.Optional[str]` +**idempotency_key:** `typing.Optional[str]` — Retrying with the same key resumes the same document rather than importing a second copy — including after a 502.
@@ -2083,7 +2083,7 @@ client.documents.import_from(
-**dedup_mode:** `typing.Optional[DocumentsImportFromRequestDedupMode]` +**dedup_mode:** `typing.Optional[DocumentsImportFromRequestDedupMode]` — always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice.
@@ -2099,7 +2099,7 @@ client.documents.import_from(
-**mode:** `typing.Optional[DocumentsImportFromRequestMode]` +**mode:** `typing.Optional[DocumentsImportFromRequestMode]` — sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256.
@@ -2199,7 +2199,7 @@ client.documents.init(
-**dedup_mode:** `typing.Optional[DocumentsInitRequestDedupMode]` +**dedup_mode:** `typing.Optional[DocumentsInitRequestDedupMode]` — always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice.
diff --git a/src/cloudpdf/core/client_wrapper.py b/src/cloudpdf/core/client_wrapper.py index 84bc498..7628337 100644 --- a/src/cloudpdf/core/client_wrapper.py +++ b/src/cloudpdf/core/client_wrapper.py @@ -33,12 +33,12 @@ def get_headers(self) -> typing.Dict[str, str]: import platform headers: typing.Dict[str, str] = { - "User-Agent": "cloudpdf/3.0.0a6", + "User-Agent": "cloudpdf/3.0.0a7", "X-Fern-Language": "Python", "X-Fern-Runtime": f"python/{platform.python_version()}", "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", "X-Fern-SDK-Name": "cloudpdf", - "X-Fern-SDK-Version": "3.0.0a6", + "X-Fern-SDK-Version": "3.0.0a7", **(self.get_custom_headers() or {}), } token = self._get_token() diff --git a/src/cloudpdf/documents/client.py b/src/cloudpdf/documents/client.py index f2768de..b3f5e5c 100644 --- a/src/cloudpdf/documents/client.py +++ b/src/cloudpdf/documents/client.py @@ -314,18 +314,23 @@ def import_from( tenant_id : str source : DocumentsImportFromRequestSource + Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file. expected : typing.Optional[DocumentsImportFromRequestExpected] + Integrity pins, enforced when present. When absent, the server-observed values become authoritative. metadata : typing.Optional[typing.Dict[str, typing.Any]] idempotency_key : typing.Optional[str] + Retrying with the same key resumes the same document rather than importing a second copy — including after a 502. dedup_mode : typing.Optional[DocumentsImportFromRequestDedupMode] + always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. doc_id : typing.Optional[str] mode : typing.Optional[DocumentsImportFromRequestMode] + sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -392,6 +397,7 @@ def init( idempotency_key : typing.Optional[str] dedup_mode : typing.Optional[DocumentsInitRequestDedupMode] + always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. doc_id : typing.Optional[str] @@ -784,18 +790,23 @@ async def import_from( tenant_id : str source : DocumentsImportFromRequestSource + Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file. expected : typing.Optional[DocumentsImportFromRequestExpected] + Integrity pins, enforced when present. When absent, the server-observed values become authoritative. metadata : typing.Optional[typing.Dict[str, typing.Any]] idempotency_key : typing.Optional[str] + Retrying with the same key resumes the same document rather than importing a second copy — including after a 502. dedup_mode : typing.Optional[DocumentsImportFromRequestDedupMode] + always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. doc_id : typing.Optional[str] mode : typing.Optional[DocumentsImportFromRequestMode] + sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -870,6 +881,7 @@ async def init( idempotency_key : typing.Optional[str] dedup_mode : typing.Optional[DocumentsInitRequestDedupMode] + always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. doc_id : typing.Optional[str] diff --git a/src/cloudpdf/documents/raw_client.py b/src/cloudpdf/documents/raw_client.py index 23b6668..0ad3bbb 100644 --- a/src/cloudpdf/documents/raw_client.py +++ b/src/cloudpdf/documents/raw_client.py @@ -531,18 +531,23 @@ def import_from( tenant_id : str source : DocumentsImportFromRequestSource + Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file. expected : typing.Optional[DocumentsImportFromRequestExpected] + Integrity pins, enforced when present. When absent, the server-observed values become authoritative. metadata : typing.Optional[typing.Dict[str, typing.Any]] idempotency_key : typing.Optional[str] + Retrying with the same key resumes the same document rather than importing a second copy — including after a 502. dedup_mode : typing.Optional[DocumentsImportFromRequestDedupMode] + always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. doc_id : typing.Optional[str] mode : typing.Optional[DocumentsImportFromRequestMode] + sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -654,6 +659,7 @@ def init( idempotency_key : typing.Optional[str] dedup_mode : typing.Optional[DocumentsInitRequestDedupMode] + always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. doc_id : typing.Optional[str] @@ -1213,18 +1219,23 @@ async def import_from( tenant_id : str source : DocumentsImportFromRequestSource + Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file. expected : typing.Optional[DocumentsImportFromRequestExpected] + Integrity pins, enforced when present. When absent, the server-observed values become authoritative. metadata : typing.Optional[typing.Dict[str, typing.Any]] idempotency_key : typing.Optional[str] + Retrying with the same key resumes the same document rather than importing a second copy — including after a 502. dedup_mode : typing.Optional[DocumentsImportFromRequestDedupMode] + always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. doc_id : typing.Optional[str] mode : typing.Optional[DocumentsImportFromRequestMode] + sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256. request_options : typing.Optional[RequestOptions] Request-specific configuration. @@ -1336,6 +1347,7 @@ async def init( idempotency_key : typing.Optional[str] dedup_mode : typing.Optional[DocumentsInitRequestDedupMode] + always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. doc_id : typing.Optional[str] diff --git a/src/cloudpdf/documents/types/documents_import_from_request_expected.py b/src/cloudpdf/documents/types/documents_import_from_request_expected.py index e2b96b4..6d8c609 100644 --- a/src/cloudpdf/documents/types/documents_import_from_request_expected.py +++ b/src/cloudpdf/documents/types/documents_import_from_request_expected.py @@ -9,10 +9,25 @@ class DocumentsImportFromRequestExpected(UniversalBaseModel): + """ + Integrity pins, enforced when present. When absent, the server-observed values become authoritative. + """ + size_bytes: typing_extensions.Annotated[ - typing.Optional[int], FieldMetadata(alias="sizeBytes"), pydantic.Field(alias="sizeBytes") + typing.Optional[int], + FieldMetadata(alias="sizeBytes"), + pydantic.Field( + alias="sizeBytes", description="Checked against the source's declared Content-Length before the transfer." + ), ] = None - sha256: typing.Optional[str] = None + """ + Checked against the source's declared Content-Length before the transfer. + """ + + sha256: typing.Optional[str] = pydantic.Field(default=None) + """ + Checked against the server-observed digest after the transfer. Required when dedupMode is reuse-existing. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/cloudpdf/documents/types/documents_import_from_request_source.py b/src/cloudpdf/documents/types/documents_import_from_request_source.py index 088686b..04b50f3 100644 --- a/src/cloudpdf/documents/types/documents_import_from_request_source.py +++ b/src/cloudpdf/documents/types/documents_import_from_request_source.py @@ -11,6 +11,10 @@ class DocumentsImportFromRequestSource_Url(UniversalBaseModel): + """ + Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file. + """ + kind: typing.Literal["url"] = "url" url: str @@ -25,6 +29,10 @@ class Config: class DocumentsImportFromRequestSource_Connection(UniversalBaseModel): + """ + Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file. + """ + kind: typing.Literal["connection"] = "connection" connection_id: typing_extensions.Annotated[ str, FieldMetadata(alias="connectionId"), pydantic.Field(alias="connectionId") diff --git a/src/cloudpdf/documents/types/documents_import_from_request_source_connection.py b/src/cloudpdf/documents/types/documents_import_from_request_source_connection.py index 0967c03..c106824 100644 --- a/src/cloudpdf/documents/types/documents_import_from_request_source_connection.py +++ b/src/cloudpdf/documents/types/documents_import_from_request_source_connection.py @@ -9,11 +9,28 @@ class DocumentsImportFromRequestSourceConnection(UniversalBaseModel): + """ + The operator pre-registered the authority: the request names a connection and a key inside it. Which provider backs the connection (S3, GCS, Azure Blob, filesystem, ...) is deployment configuration, never wire surface. + """ + connection_id: typing_extensions.Annotated[ - str, FieldMetadata(alias="connectionId"), pydantic.Field(alias="connectionId") + str, + FieldMetadata(alias="connectionId"), + pydantic.Field(alias="connectionId", description="The operator-registered storage connection to read from."), ] - key: str - revision: typing.Optional[str] = None + """ + The operator-registered storage connection to read from. + """ + + key: str = pydantic.Field() + """ + The object key to read, inside the connection's configured scope. At most 1024 UTF-8 bytes. + """ + + revision: typing.Optional[str] = pydantic.Field(default=None) + """ + Pins a specific version of the object. Provider-interpreted (S3 VersionId, GCS generation, Azure version id); providers without versioning reject it. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/cloudpdf/documents/types/documents_import_from_request_source_url.py b/src/cloudpdf/documents/types/documents_import_from_request_source_url.py index 1fcab13..1e0d733 100644 --- a/src/cloudpdf/documents/types/documents_import_from_request_source_url.py +++ b/src/cloudpdf/documents/types/documents_import_from_request_source_url.py @@ -7,7 +7,14 @@ class DocumentsImportFromRequestSourceUrl(UniversalBaseModel): - url: str + """ + The caller supplies the authority: a presigned S3/GCS/Azure/R2/MinIO GET, or any HTTPS endpoint the deployment import policy allows. The URL is a capability — treat it as a secret. CloudPDF never echoes its query string back in errors, logs, or stored failure reasons. + """ + + url: str = pydantic.Field() + """ + The URL to fetch. Must be allowed by the deployment import policy (scheme, network range, size) and must declare a length. + """ if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2