From 440c434d8cafbd43ba5182ad8d7dacca9cacfc8e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 11:57:09 -0400 Subject: [PATCH 1/3] build: [autoapprove] bump cryptography from 41.0.2 to 41.0.3 (#510) * build: [autoapprove] bump cryptography from 41.0.2 to 41.0.3 Source-Link: https://github.com/googleapis/synthtool/commit/352b9d4c068ce7c05908172af128b294073bf53c Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3e3800bb100af5d7f9e810d48212b37812c1856d20ffeafb99ebe66461b61fc7 * lint E721 --------- Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .github/.OwlBot.lock.yaml | 4 +-- .kokoro/requirements.txt | 48 ++++++++++++++--------------- .pre-commit-config.yaml | 2 +- google/cloud/translate_v2/client.py | 2 +- noxfile.py | 3 +- 5 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 0ddd0e4d..a3da1b0d 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:6c1cbc75c74b8bdd71dada2fa1677e9d6d78a889e9a70ee75b93d1d0543f96e1 -# created: 2023-07-25T21:01:10.396410762Z + digest: sha256:3e3800bb100af5d7f9e810d48212b37812c1856d20ffeafb99ebe66461b61fc7 +# created: 2023-08-02T10:53:29.114535628Z diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 76d9bba0..029bd342 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -113,30 +113,30 @@ commonmark==0.9.1 \ --hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 \ --hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9 # via rich -cryptography==41.0.2 \ - --hash=sha256:01f1d9e537f9a15b037d5d9ee442b8c22e3ae11ce65ea1f3316a41c78756b711 \ - --hash=sha256:079347de771f9282fbfe0e0236c716686950c19dee1b76240ab09ce1624d76d7 \ - --hash=sha256:182be4171f9332b6741ee818ec27daff9fb00349f706629f5cbf417bd50e66fd \ - --hash=sha256:192255f539d7a89f2102d07d7375b1e0a81f7478925b3bc2e0549ebf739dae0e \ - --hash=sha256:2a034bf7d9ca894720f2ec1d8b7b5832d7e363571828037f9e0c4f18c1b58a58 \ - --hash=sha256:342f3767e25876751e14f8459ad85e77e660537ca0a066e10e75df9c9e9099f0 \ - --hash=sha256:439c3cc4c0d42fa999b83ded80a9a1fb54d53c58d6e59234cfe97f241e6c781d \ - --hash=sha256:49c3222bb8f8e800aead2e376cbef687bc9e3cb9b58b29a261210456a7783d83 \ - --hash=sha256:674b669d5daa64206c38e507808aae49904c988fa0a71c935e7006a3e1e83831 \ - --hash=sha256:7a9a3bced53b7f09da251685224d6a260c3cb291768f54954e28f03ef14e3766 \ - --hash=sha256:7af244b012711a26196450d34f483357e42aeddb04128885d95a69bd8b14b69b \ - --hash=sha256:7d230bf856164de164ecb615ccc14c7fc6de6906ddd5b491f3af90d3514c925c \ - --hash=sha256:84609ade00a6ec59a89729e87a503c6e36af98ddcd566d5f3be52e29ba993182 \ - --hash=sha256:9a6673c1828db6270b76b22cc696f40cde9043eb90373da5c2f8f2158957f42f \ - --hash=sha256:9b6d717393dbae53d4e52684ef4f022444fc1cce3c48c38cb74fca29e1f08eaa \ - --hash=sha256:9c3fe6534d59d071ee82081ca3d71eed3210f76ebd0361798c74abc2bcf347d4 \ - --hash=sha256:a719399b99377b218dac6cf547b6ec54e6ef20207b6165126a280b0ce97e0d2a \ - --hash=sha256:b332cba64d99a70c1e0836902720887fb4529ea49ea7f5462cf6640e095e11d2 \ - --hash=sha256:d124682c7a23c9764e54ca9ab5b308b14b18eba02722b8659fb238546de83a76 \ - --hash=sha256:d73f419a56d74fef257955f51b18d046f3506270a5fd2ac5febbfa259d6c0fa5 \ - --hash=sha256:f0dc40e6f7aa37af01aba07277d3d64d5a03dc66d682097541ec4da03cc140ee \ - --hash=sha256:f14ad275364c8b4e525d018f6716537ae7b6d369c094805cae45300847e0894f \ - --hash=sha256:f772610fe364372de33d76edcd313636a25684edb94cee53fd790195f5989d14 +cryptography==41.0.3 \ + --hash=sha256:0d09fb5356f975974dbcb595ad2d178305e5050656affb7890a1583f5e02a306 \ + --hash=sha256:23c2d778cf829f7d0ae180600b17e9fceea3c2ef8b31a99e3c694cbbf3a24b84 \ + --hash=sha256:3fb248989b6363906827284cd20cca63bb1a757e0a2864d4c1682a985e3dca47 \ + --hash=sha256:41d7aa7cdfded09b3d73a47f429c298e80796c8e825ddfadc84c8a7f12df212d \ + --hash=sha256:42cb413e01a5d36da9929baa9d70ca90d90b969269e5a12d39c1e0d475010116 \ + --hash=sha256:4c2f0d35703d61002a2bbdcf15548ebb701cfdd83cdc12471d2bae80878a4207 \ + --hash=sha256:4fd871184321100fb400d759ad0cddddf284c4b696568204d281c902fc7b0d81 \ + --hash=sha256:5259cb659aa43005eb55a0e4ff2c825ca111a0da1814202c64d28a985d33b087 \ + --hash=sha256:57a51b89f954f216a81c9d057bf1a24e2f36e764a1ca9a501a6964eb4a6800dd \ + --hash=sha256:652627a055cb52a84f8c448185922241dd5217443ca194d5739b44612c5e6507 \ + --hash=sha256:67e120e9a577c64fe1f611e53b30b3e69744e5910ff3b6e97e935aeb96005858 \ + --hash=sha256:6af1c6387c531cd364b72c28daa29232162010d952ceb7e5ca8e2827526aceae \ + --hash=sha256:6d192741113ef5e30d89dcb5b956ef4e1578f304708701b8b73d38e3e1461f34 \ + --hash=sha256:7efe8041897fe7a50863e51b77789b657a133c75c3b094e51b5e4b5cec7bf906 \ + --hash=sha256:84537453d57f55a50a5b6835622ee405816999a7113267739a1b4581f83535bd \ + --hash=sha256:8f09daa483aedea50d249ef98ed500569841d6498aa9c9f4b0531b9964658922 \ + --hash=sha256:95dd7f261bb76948b52a5330ba5202b91a26fbac13ad0e9fc8a3ac04752058c7 \ + --hash=sha256:a74fbcdb2a0d46fe00504f571a2a540532f4c188e6ccf26f1f178480117b33c4 \ + --hash=sha256:a983e441a00a9d57a4d7c91b3116a37ae602907a7618b882c8013b5762e80574 \ + --hash=sha256:ab8de0d091acbf778f74286f4989cf3d1528336af1b59f3e5d2ebca8b5fe49e1 \ + --hash=sha256:aeb57c421b34af8f9fe830e1955bf493a86a7996cc1338fe41b30047d16e962c \ + --hash=sha256:ce785cf81a7bdade534297ef9e490ddff800d956625020ab2ec2780a556c313e \ + --hash=sha256:d0d651aa754ef58d75cec6edfbd21259d93810b73f6ec246436a21b7841908de # via # gcp-releasetool # secretstorage diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e3898fd..19409cbd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,6 +26,6 @@ repos: hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 3.9.2 + rev: 6.1.0 hooks: - id: flake8 diff --git a/google/cloud/translate_v2/client.py b/google/cloud/translate_v2/client.py index e4e4840c..a5b6c0f3 100644 --- a/google/cloud/translate_v2/client.py +++ b/google/cloud/translate_v2/client.py @@ -81,7 +81,7 @@ def __init__( kw_args = {"client_info": client_info} if client_options: - if type(client_options) == dict: + if isinstance(client_options, dict): client_options = google.api_core.client_options.from_dict( client_options ) diff --git a/noxfile.py b/noxfile.py index 5ff54976..2b3b1bfa 100644 --- a/noxfile.py +++ b/noxfile.py @@ -25,6 +25,7 @@ import nox +FLAKE8_VERSION = "flake8==6.1.0" BLACK_VERSION = "black==22.3.0" ISORT_VERSION = "isort==5.10.1" LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] @@ -81,7 +82,7 @@ def lint(session): Returns a failure if the linters find linting errors or sufficiently serious code quality issues. """ - session.install("flake8", BLACK_VERSION) + session.install(FLAKE8_VERSION, BLACK_VERSION) session.run( "black", "--check", From 285059ab033410226003d92b44fa83f9b4a78606 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 10:13:41 -0400 Subject: [PATCH 2/3] feat: Added shadow removal and rotation correction options to Document Translation and Batch Document Translation API (#511) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Added shadow removal and rotation correction options to Document Translation and Batch Document Translation API PiperOrigin-RevId: 554540042 Source-Link: https://github.com/googleapis/googleapis/commit/a3aded7c2872f2363e8ff1496d37ed90e01ce49a Source-Link: https://github.com/googleapis/googleapis-gen/commit/07b1ee544ff188f96e8e08b39186cd1e104e1984 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDdiMWVlNTQ0ZmYxODhmOTZlOGUwOGIzOTE4NmNkMWUxMDRlMTk4NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Added shadow removal and rotation correction options to Document Translation and Batch Document Translation API PiperOrigin-RevId: 554540978 Source-Link: https://github.com/googleapis/googleapis/commit/8cf2ae173bc7f1db42f37da94ab43597344866d9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5a136ebbed847eb9e72deb672d0481ff04ab0398 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWExMzZlYmJlZDg0N2ViOWU3MmRlYjY3MmQwNDgxZmYwNGFiMDM5OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../translation_service/async_client.py | 2 +- .../services/translation_service/client.py | 2 +- .../translate_v3/types/translation_service.py | 47 +++++++++--- .../translation_service/async_client.py | 12 ++-- .../services/translation_service/client.py | 12 ++-- .../translation_service/transports/grpc.py | 12 ++-- .../transports/grpc_asyncio.py | 12 ++-- .../types/translation_service.py | 72 +++++++++++++++++-- scripts/fixup_translate_v3_keywords.py | 4 +- scripts/fixup_translate_v3beta1_keywords.py | 4 +- 10 files changed, 133 insertions(+), 46 deletions(-) diff --git a/google/cloud/translate_v3/services/translation_service/async_client.py b/google/cloud/translate_v3/services/translation_service/async_client.py index f119458e..446a337f 100644 --- a/google/cloud/translate_v3/services/translation_service/async_client.py +++ b/google/cloud/translate_v3/services/translation_service/async_client.py @@ -322,7 +322,7 @@ async def sample_translate_text(): ``projects/{project-number-or-id}/locations/global/models/general/nmt``. If not provided, the default Google model (NMT) will be - used. + used This corresponds to the ``model`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/translate_v3/services/translation_service/client.py b/google/cloud/translate_v3/services/translation_service/client.py index c41e0104..26c8867e 100644 --- a/google/cloud/translate_v3/services/translation_service/client.py +++ b/google/cloud/translate_v3/services/translation_service/client.py @@ -550,7 +550,7 @@ def sample_translate_text(): ``projects/{project-number-or-id}/locations/global/models/general/nmt``. If not provided, the default Google model (NMT) will be - used. + used This corresponds to the ``model`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/translate_v3/types/translation_service.py b/google/cloud/translate_v3/types/translation_service.py index 52abf39e..b96b92af 100644 --- a/google/cloud/translate_v3/types/translation_service.py +++ b/google/cloud/translate_v3/types/translation_service.py @@ -67,8 +67,8 @@ class TranslateTextGlossaryConfig(proto.Message): - r"""Configures which glossary should be used for a specific - target language, and defines options for applying that glossary. + r"""Configures which glossary is used for a specific target + language and defines options for applying that glossary. Attributes: glossary (str): @@ -152,8 +152,7 @@ class TranslateTextRequest(proto.Message): ``global``. For example, ``projects/{project-number-or-id}/locations/global/models/general/nmt``. - If not provided, the default Google model (NMT) will be - used. + If not provided, the default Google model (NMT) will be used glossary_config (google.cloud.translate_v3.types.TranslateTextGlossaryConfig): Optional. Glossary to be applied. The glossary must be within the same region (have the same location-id) as the @@ -904,14 +903,19 @@ class TranslateDocumentRequest(proto.Message): should follow rules in https://cloud.google.com/translate/attribution#attribution_and_logos is_translate_native_pdf_only (bool): - Optional. If true, the page limit of online - native pdf translation is 300 and only native - pdf pages will be translated. + Optional. is_translate_native_pdf_only field for external + customers. If true, the page limit of online native pdf + translation is 300 and only native pdf pages will be + translated. enable_shadow_removal_native_pdf (bool): - Optional. If true, use the text removal to remove the shadow - text on background image for native pdf translation. Shadow - removal feature can only be enabled when - is_translate_native_pdf_only is false + Optional. If true, use the text removal server to remove the + shadow text on background image for native pdf translation. + Shadow removal feature can only be enabled when + is_translate_native_pdf_only: false && pdf_native_only: + false + enable_rotation_correction (bool): + Optional. If true, enable auto rotation + correction in DVS. """ parent: str = proto.Field( @@ -962,6 +966,10 @@ class TranslateDocumentRequest(proto.Message): proto.BOOL, number=12, ) + enable_rotation_correction: bool = proto.Field( + proto.BOOL, + number=13, + ) class DocumentTranslation(proto.Message): @@ -1807,6 +1815,15 @@ class BatchTranslateDocumentRequest(proto.Message): ``Machine Translated by Google``. Customized attribution should follow rules in https://cloud.google.com/translate/attribution#attribution_and_logos + enable_shadow_removal_native_pdf (bool): + Optional. If true, use the text removal server to remove the + shadow text on background image for native pdf translation. + Shadow removal feature can only be enabled when + is_translate_native_pdf_only: false && pdf_native_only: + false + enable_rotation_correction (bool): + Optional. If true, enable auto rotation + correction in DVS. """ parent: str = proto.Field( @@ -1851,6 +1868,14 @@ class BatchTranslateDocumentRequest(proto.Message): proto.STRING, number=10, ) + enable_shadow_removal_native_pdf: bool = proto.Field( + proto.BOOL, + number=11, + ) + enable_rotation_correction: bool = proto.Field( + proto.BOOL, + number=12, + ) class BatchDocumentInputConfig(proto.Message): diff --git a/google/cloud/translate_v3beta1/services/translation_service/async_client.py b/google/cloud/translate_v3beta1/services/translation_service/async_client.py index 00730def..5df0bd36 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/async_client.py +++ b/google/cloud/translate_v3beta1/services/translation_service/async_client.py @@ -824,12 +824,12 @@ async def batch_translate_document( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: - r"""Translates a large volume of documents in - asynchronous batch mode. This function provides - real-time output as the inputs are being processed. If - caller cancels a request, the partial results (for an - input file, it's all or nothing) may still be available - on the specified output location. + r"""Translates a large volume of document in asynchronous + batch mode. This function provides real-time output as + the inputs are being processed. If caller cancels a + request, the partial results (for an input file, it's + all or nothing) may still be available on the specified + output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call. diff --git a/google/cloud/translate_v3beta1/services/translation_service/client.py b/google/cloud/translate_v3beta1/services/translation_service/client.py index 142b4105..079d9deb 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/client.py +++ b/google/cloud/translate_v3beta1/services/translation_service/client.py @@ -1045,12 +1045,12 @@ def batch_translate_document( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: - r"""Translates a large volume of documents in - asynchronous batch mode. This function provides - real-time output as the inputs are being processed. If - caller cancels a request, the partial results (for an - input file, it's all or nothing) may still be available - on the specified output location. + r"""Translates a large volume of document in asynchronous + batch mode. This function provides real-time output as + the inputs are being processed. If caller cancels a + request, the partial results (for an input file, it's + all or nothing) may still be available on the specified + output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call. diff --git a/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py b/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py index 511459d2..16a71ad5 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py +++ b/google/cloud/translate_v3beta1/services/translation_service/transports/grpc.py @@ -407,12 +407,12 @@ def batch_translate_document( ]: r"""Return a callable for the batch translate document method over gRPC. - Translates a large volume of documents in - asynchronous batch mode. This function provides - real-time output as the inputs are being processed. If - caller cancels a request, the partial results (for an - input file, it's all or nothing) may still be available - on the specified output location. + Translates a large volume of document in asynchronous + batch mode. This function provides real-time output as + the inputs are being processed. If caller cancels a + request, the partial results (for an input file, it's + all or nothing) may still be available on the specified + output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call. diff --git a/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py b/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py index 0c48e822..30a0bc9a 100644 --- a/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py +++ b/google/cloud/translate_v3beta1/services/translation_service/transports/grpc_asyncio.py @@ -414,12 +414,12 @@ def batch_translate_document( ]: r"""Return a callable for the batch translate document method over gRPC. - Translates a large volume of documents in - asynchronous batch mode. This function provides - real-time output as the inputs are being processed. If - caller cancels a request, the partial results (for an - input file, it's all or nothing) may still be available - on the specified output location. + Translates a large volume of document in asynchronous + batch mode. This function provides real-time output as + the inputs are being processed. If caller cancels a + request, the partial results (for an input file, it's + all or nothing) may still be available on the specified + output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call. diff --git a/google/cloud/translate_v3beta1/types/translation_service.py b/google/cloud/translate_v3beta1/types/translation_service.py index 58918e6b..fe2180c3 100644 --- a/google/cloud/translate_v3beta1/types/translation_service.py +++ b/google/cloud/translate_v3beta1/types/translation_service.py @@ -630,7 +630,7 @@ class OutputConfig(proto.Message): Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. - (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy) + (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The format of translations_file (for target language code 'trg') is: @@ -887,6 +887,26 @@ class TranslateDocumentRequest(proto.Message): See https://cloud.google.com/translate/docs/advanced/labels for more information. + customized_attribution (str): + Optional. This flag is to support user customized + attribution. If not provided, the default is + ``Machine Translated by Google``. Customized attribution + should follow rules in + https://cloud.google.com/translate/attribution#attribution_and_logos + is_translate_native_pdf_only (bool): + Optional. is_translate_native_pdf_only field for external + customers. If true, the page limit of online native pdf + translation is 300 and only native pdf pages will be + translated. + enable_shadow_removal_native_pdf (bool): + Optional. If true, use the text removal server to remove the + shadow text on background image for native pdf translation. + Shadow removal feature can only be enabled when + is_translate_native_pdf_only: false && pdf_native_only: + false + enable_rotation_correction (bool): + Optional. If true, enable auto rotation + correction in DVS. """ parent: str = proto.Field( @@ -925,6 +945,22 @@ class TranslateDocumentRequest(proto.Message): proto.STRING, number=8, ) + customized_attribution: str = proto.Field( + proto.STRING, + number=10, + ) + is_translate_native_pdf_only: bool = proto.Field( + proto.BOOL, + number=11, + ) + enable_shadow_removal_native_pdf: bool = proto.Field( + proto.BOOL, + number=12, + ) + enable_rotation_correction: bool = proto.Field( + proto.BOOL, + number=13, + ) class DocumentTranslation(proto.Message): @@ -1266,10 +1302,9 @@ class GlossaryInputConfig(proto.Message): For equivalent term sets glossaries: - CSV (``.csv``): Multi-column CSV file defining equivalent - glossary terms in multiple languages. The format is - defined for Google Translation Toolkit and documented in - `Use a - glossary `__. + glossary terms in multiple languages. See documentation + for more information - + `glossaries `__. This field is a member of `oneof`_ ``source``. """ @@ -1760,6 +1795,21 @@ class BatchTranslateDocumentRequest(proto.Message): If nothing specified, output files will be in the same format as the original file. + customized_attribution (str): + Optional. This flag is to support user customized + attribution. If not provided, the default is + ``Machine Translated by Google``. Customized attribution + should follow rules in + https://cloud.google.com/translate/attribution#attribution_and_logos + enable_shadow_removal_native_pdf (bool): + Optional. If true, use the text removal server to remove the + shadow text on background image for native pdf translation. + Shadow removal feature can only be enabled when + is_translate_native_pdf_only: false && pdf_native_only: + false + enable_rotation_correction (bool): + Optional. If true, enable auto rotation + correction in DVS. """ parent: str = proto.Field( @@ -1800,6 +1850,18 @@ class BatchTranslateDocumentRequest(proto.Message): proto.STRING, number=8, ) + customized_attribution: str = proto.Field( + proto.STRING, + number=10, + ) + enable_shadow_removal_native_pdf: bool = proto.Field( + proto.BOOL, + number=11, + ) + enable_rotation_correction: bool = proto.Field( + proto.BOOL, + number=12, + ) class BatchDocumentInputConfig(proto.Message): diff --git a/scripts/fixup_translate_v3_keywords.py b/scripts/fixup_translate_v3_keywords.py index dfdad625..ef488ce1 100644 --- a/scripts/fixup_translate_v3_keywords.py +++ b/scripts/fixup_translate_v3_keywords.py @@ -39,7 +39,7 @@ def partition( class translateCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'batch_translate_document': ('parent', 'source_language_code', 'target_language_codes', 'input_configs', 'output_config', 'models', 'glossaries', 'format_conversions', 'customized_attribution', ), + 'batch_translate_document': ('parent', 'source_language_code', 'target_language_codes', 'input_configs', 'output_config', 'models', 'glossaries', 'format_conversions', 'customized_attribution', 'enable_shadow_removal_native_pdf', 'enable_rotation_correction', ), 'batch_translate_text': ('parent', 'source_language_code', 'target_language_codes', 'input_configs', 'output_config', 'models', 'glossaries', 'labels', ), 'create_glossary': ('parent', 'glossary', ), 'delete_glossary': ('name', ), @@ -47,7 +47,7 @@ class translateCallTransformer(cst.CSTTransformer): 'get_glossary': ('name', ), 'get_supported_languages': ('parent', 'display_language_code', 'model', ), 'list_glossaries': ('parent', 'page_size', 'page_token', 'filter', ), - 'translate_document': ('parent', 'target_language_code', 'document_input_config', 'source_language_code', 'document_output_config', 'model', 'glossary_config', 'labels', 'customized_attribution', 'is_translate_native_pdf_only', 'enable_shadow_removal_native_pdf', ), + 'translate_document': ('parent', 'target_language_code', 'document_input_config', 'source_language_code', 'document_output_config', 'model', 'glossary_config', 'labels', 'customized_attribution', 'is_translate_native_pdf_only', 'enable_shadow_removal_native_pdf', 'enable_rotation_correction', ), 'translate_text': ('contents', 'target_language_code', 'parent', 'mime_type', 'source_language_code', 'model', 'glossary_config', 'labels', ), } diff --git a/scripts/fixup_translate_v3beta1_keywords.py b/scripts/fixup_translate_v3beta1_keywords.py index 3cc922af..ef488ce1 100644 --- a/scripts/fixup_translate_v3beta1_keywords.py +++ b/scripts/fixup_translate_v3beta1_keywords.py @@ -39,7 +39,7 @@ def partition( class translateCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'batch_translate_document': ('parent', 'source_language_code', 'target_language_codes', 'input_configs', 'output_config', 'models', 'glossaries', 'format_conversions', ), + 'batch_translate_document': ('parent', 'source_language_code', 'target_language_codes', 'input_configs', 'output_config', 'models', 'glossaries', 'format_conversions', 'customized_attribution', 'enable_shadow_removal_native_pdf', 'enable_rotation_correction', ), 'batch_translate_text': ('parent', 'source_language_code', 'target_language_codes', 'input_configs', 'output_config', 'models', 'glossaries', 'labels', ), 'create_glossary': ('parent', 'glossary', ), 'delete_glossary': ('name', ), @@ -47,7 +47,7 @@ class translateCallTransformer(cst.CSTTransformer): 'get_glossary': ('name', ), 'get_supported_languages': ('parent', 'display_language_code', 'model', ), 'list_glossaries': ('parent', 'page_size', 'page_token', 'filter', ), - 'translate_document': ('parent', 'target_language_code', 'document_input_config', 'source_language_code', 'document_output_config', 'model', 'glossary_config', 'labels', ), + 'translate_document': ('parent', 'target_language_code', 'document_input_config', 'source_language_code', 'document_output_config', 'model', 'glossary_config', 'labels', 'customized_attribution', 'is_translate_native_pdf_only', 'enable_shadow_removal_native_pdf', 'enable_rotation_correction', ), 'translate_text': ('contents', 'target_language_code', 'parent', 'mime_type', 'source_language_code', 'model', 'glossary_config', 'labels', ), } From 20617c4e9656d818eb2aca3f46fe4618e640215c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 10:58:26 -0400 Subject: [PATCH 3/3] chore(main): release 3.12.0 (#512) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ google/cloud/translate/gapic_version.py | 2 +- google/cloud/translate_v3/gapic_version.py | 2 +- google/cloud/translate_v3beta1/gapic_version.py | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 28cac7f5..a4719973 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.11.3" + ".": "3.12.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index cb977afe..5b07fc2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-translate/#history +## [3.12.0](https://github.com/googleapis/python-translate/compare/v3.11.3...v3.12.0) (2023-08-08) + + +### Features + +* Added shadow removal and rotation correction options to Document Translation and Batch Document Translation API ([#511](https://github.com/googleapis/python-translate/issues/511)) ([285059a](https://github.com/googleapis/python-translate/commit/285059ab033410226003d92b44fa83f9b4a78606)) + ## [3.11.3](https://github.com/googleapis/python-translate/compare/v3.11.2...v3.11.3) (2023-07-28) diff --git a/google/cloud/translate/gapic_version.py b/google/cloud/translate/gapic_version.py index 69b0cd30..b5a6e376 100644 --- a/google/cloud/translate/gapic_version.py +++ b/google/cloud/translate/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.11.3" # {x-release-please-version} +__version__ = "3.12.0" # {x-release-please-version} diff --git a/google/cloud/translate_v3/gapic_version.py b/google/cloud/translate_v3/gapic_version.py index 69b0cd30..b5a6e376 100644 --- a/google/cloud/translate_v3/gapic_version.py +++ b/google/cloud/translate_v3/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.11.3" # {x-release-please-version} +__version__ = "3.12.0" # {x-release-please-version} diff --git a/google/cloud/translate_v3beta1/gapic_version.py b/google/cloud/translate_v3beta1/gapic_version.py index 69b0cd30..b5a6e376 100644 --- a/google/cloud/translate_v3beta1/gapic_version.py +++ b/google/cloud/translate_v3beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.11.3" # {x-release-please-version} +__version__ = "3.12.0" # {x-release-please-version}