From ee2382930c58a964efc719233f1bf9bcff951055 Mon Sep 17 00:00:00 2001 From: Nick Cook Date: Thu, 24 Feb 2022 13:25:42 -0800 Subject: [PATCH 1/2] fix: revise samples with fix from #138 --- .../create_job_with_embedded_captions.py | 35 ++++++------------- .../create_job_with_standalone_captions.py | 35 ++++++------------- 2 files changed, 20 insertions(+), 50 deletions(-) diff --git a/samples/snippets/create_job_with_embedded_captions.py b/samples/snippets/create_job_with_embedded_captions.py index a81e668..0f6303a 100644 --- a/samples/snippets/create_job_with_embedded_captions.py +++ b/samples/snippets/create_job_with_embedded_captions.py @@ -81,31 +81,16 @@ def create_job_with_embedded_captions( ), transcoder_v1.types.ElementaryStream( key="cea-stream0", - # The following doesn't work because "mapping" is a reserved - # argument name in GCP python client libraries (see - # https://github.com/googleapis/proto-plus-python/blob/main/proto/message.py#L447): - # - # text_stream=transcoder_v1.types.TextStream( - # codec="cea608", - # mapping=[ - # transcoder_v1.types.TextStream.TextMapping( - # atom_key="atom0", - # input_key="caption-input0", - # input_track=0, - # ), - # ], - # ), - # Use a python dictionary as a workaround: - text_stream={ - "codec": "cea608", - "mapping": [ - { - "atom_key": "atom0", - "input_key": "caption-input0", - "input_track": 0, - } - ], - }, + text_stream=transcoder_v1.types.TextStream( + codec="cea608", + mapping_=[ + transcoder_v1.types.TextStream.TextMapping( + atom_key="atom0", + input_key="caption-input0", + input_track=0, + ), + ], + ), ), ], mux_streams=[ diff --git a/samples/snippets/create_job_with_standalone_captions.py b/samples/snippets/create_job_with_standalone_captions.py index de32f49..ba1ddeb 100644 --- a/samples/snippets/create_job_with_standalone_captions.py +++ b/samples/snippets/create_job_with_standalone_captions.py @@ -82,31 +82,16 @@ def create_job_with_standalone_captions( ), transcoder_v1.types.ElementaryStream( key="vtt-stream0", - # The following doesn't work because "mapping" is a reserved - # argument name in GCP python client libraries (see - # https://github.com/googleapis/proto-plus-python/blob/main/proto/message.py#L447): - # - # text_stream=transcoder_v1.types.TextStream( - # codec="webvtt", - # mapping=[ - # transcoder_v1.types.TextStream.TextMapping( - # atom_key="atom0", - # input_key="caption-input0", - # input_track=0, - # ), - # ], - # ), - # Use a python dictionary as a workaround: - text_stream={ - "codec": "webvtt", - "mapping": [ - { - "atom_key": "atom0", - "input_key": "caption-input0", - "input_track": 0, - } - ], - }, + text_stream=transcoder_v1.types.TextStream( + codec="webvtt", + mapping_=[ + transcoder_v1.types.TextStream.TextMapping( + atom_key="atom0", + input_key="caption-input0", + input_track=0, + ), + ], + ), ), ], mux_streams=[ From b9f0cbda1465a5febdc071e490af54df4918d98d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 24 Feb 2022 21:36:10 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../snippets/create_job_with_embedded_captions.py | 14 ++++++-------- .../create_job_with_standalone_captions.py | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/samples/snippets/create_job_with_embedded_captions.py b/samples/snippets/create_job_with_embedded_captions.py index 0f6303a..c28a066 100644 --- a/samples/snippets/create_job_with_embedded_captions.py +++ b/samples/snippets/create_job_with_embedded_captions.py @@ -82,14 +82,12 @@ def create_job_with_embedded_captions( transcoder_v1.types.ElementaryStream( key="cea-stream0", text_stream=transcoder_v1.types.TextStream( - codec="cea608", - mapping_=[ - transcoder_v1.types.TextStream.TextMapping( - atom_key="atom0", - input_key="caption-input0", - input_track=0, - ), - ], + codec="cea608", + mapping_=[ + transcoder_v1.types.TextStream.TextMapping( + atom_key="atom0", input_key="caption-input0", input_track=0, + ), + ], ), ), ], diff --git a/samples/snippets/create_job_with_standalone_captions.py b/samples/snippets/create_job_with_standalone_captions.py index ba1ddeb..49ccfc8 100644 --- a/samples/snippets/create_job_with_standalone_captions.py +++ b/samples/snippets/create_job_with_standalone_captions.py @@ -83,14 +83,12 @@ def create_job_with_standalone_captions( transcoder_v1.types.ElementaryStream( key="vtt-stream0", text_stream=transcoder_v1.types.TextStream( - codec="webvtt", - mapping_=[ - transcoder_v1.types.TextStream.TextMapping( - atom_key="atom0", - input_key="caption-input0", - input_track=0, - ), - ], + codec="webvtt", + mapping_=[ + transcoder_v1.types.TextStream.TextMapping( + atom_key="atom0", input_key="caption-input0", input_track=0, + ), + ], ), ), ],