diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 6301519a9..26306af66 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:2ed982f884312e4883e01b5ab8af8b6935f0216a5a2d82928d273081fc3be562 -# created: 2024-11-12T12:09:45.821174897Z + digest: sha256:8e3e7e18255c22d1489258d0374c901c01f9c4fd77a12088670cd73d580aa737 +# created: 2024-12-17T00:59:58.625514486Z diff --git a/.kokoro/docker/docs/requirements.txt b/.kokoro/docker/docs/requirements.txt index 8bb076459..f99a5c4aa 100644 --- a/.kokoro/docker/docs/requirements.txt +++ b/.kokoro/docker/docs/requirements.txt @@ -2,11 +2,11 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --allow-unsafe --generate-hashes requirements.in +# pip-compile --allow-unsafe --generate-hashes synthtool/gcp/templates/python_library/.kokoro/docker/docs/requirements.in # -argcomplete==3.5.1 \ - --hash=sha256:1a1d148bdaa3e3b93454900163403df41448a248af01b6e849edc5ac08e6c363 \ - --hash=sha256:eb1ee355aa2557bd3d0145de7b06b2a45b0ce461e1e7813f5d066039ab4177b4 +argcomplete==3.5.2 \ + --hash=sha256:036d020d79048a5d525bc63880d7a4b8d1668566b8a76daf1144c0bbe0f63472 \ + --hash=sha256:23146ed7ac4403b70bd6026402468942ceba34a6732255b9edf5b7354f68a6bb # via nox colorlog==6.9.0 \ --hash=sha256:5906e71acd67cb07a71e779c47c4bcb45fb8c2993eebe9e5adcd6a6f1b283eff \ @@ -23,7 +23,7 @@ filelock==3.16.1 \ nox==2024.10.9 \ --hash=sha256:1d36f309a0a2a853e9bccb76bbef6bb118ba92fa92674d15604ca99adeb29eab \ --hash=sha256:7aa9dc8d1c27e9f45ab046ffd1c3b2c4f7c91755304769df231308849ebded95 - # via -r requirements.in + # via -r synthtool/gcp/templates/python_library/.kokoro/docker/docs/requirements.in packaging==24.2 \ --hash=sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759 \ --hash=sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f @@ -32,11 +32,41 @@ platformdirs==4.3.6 \ --hash=sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907 \ --hash=sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb # via virtualenv -tomli==2.0.2 \ - --hash=sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38 \ - --hash=sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed +tomli==2.2.1 \ + --hash=sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6 \ + --hash=sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd \ + --hash=sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c \ + --hash=sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b \ + --hash=sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8 \ + --hash=sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6 \ + --hash=sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77 \ + --hash=sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff \ + --hash=sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea \ + --hash=sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192 \ + --hash=sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249 \ + --hash=sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee \ + --hash=sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4 \ + --hash=sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98 \ + --hash=sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8 \ + --hash=sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4 \ + --hash=sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281 \ + --hash=sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744 \ + --hash=sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69 \ + --hash=sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13 \ + --hash=sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140 \ + --hash=sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e \ + --hash=sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e \ + --hash=sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc \ + --hash=sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff \ + --hash=sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec \ + --hash=sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2 \ + --hash=sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222 \ + --hash=sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106 \ + --hash=sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272 \ + --hash=sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a \ + --hash=sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7 # via nox -virtualenv==20.27.1 \ - --hash=sha256:142c6be10212543b32c6c45d3d3893dff89112cc588b7d0879ae5a1ec03a47ba \ - --hash=sha256:f11f1b8a29525562925f745563bfd48b189450f61fb34c4f9cc79dd5aa32a1f4 +virtualenv==20.28.0 \ + --hash=sha256:23eae1b4516ecd610481eda647f3a7c09aea295055337331bb4e6892ecce47b0 \ + --hash=sha256:2c9c3262bb8e7b87ea801d715fae4495e6032450c71d2309be9550e7364049aa # via nox diff --git a/WORKSPACE b/WORKSPACE index 99163725c..86d90144c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -73,9 +73,9 @@ http_archive( # instantiated in grpc_deps(). http_archive( name = "com_google_protobuf", - sha256 = "10a0d58f39a1a909e95e00e8ba0b5b1dc64d02997f741151953a2b3659f6e78c", - strip_prefix = "protobuf-29.0", - urls = ["https://github.com/protocolbuffers/protobuf/archive/v29.0.tar.gz"], + sha256 = "63150aba23f7a90fd7d87bdf514e459dd5fe7023fdde01b56ac53335df64d4bd", + strip_prefix = "protobuf-29.2", + urls = ["https://github.com/protocolbuffers/protobuf/archive/v29.2.tar.gz"], ) load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 index f588391bd..e96594c01 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2 @@ -383,13 +383,36 @@ class {{ async_method_name_prefix }}{{ service.name }}RestInterceptor: {% endif %} """Post-rpc interceptor for {{ method.name|snake_case }} - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_{{ method.name|snake_case }}_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the {{ service.name }} server but before - it is returned to user code. + it is returned to user code. This `post_{{ method.name|snake_case }}` interceptor runs + before the `post_{{ method.name|snake_case }}_with_metadata` interceptor. """ return response + {% if not method.server_streaming %} + {{ async_prefix }}def post_{{ method.name|snake_case }}_with_metadata(self, response: {{method.output.ident}}, {{ client_method_metadata_argument() }}) -> Tuple[{{method.output.ident}}, {{ client_method_metadata_type() }}]: + {% else %} + {{ async_prefix }}def post_{{ method.name|snake_case }}_with_metadata(self, response: rest_streaming{{ async_suffix }}.{{ async_method_name_prefix }}ResponseIterator, {{ client_method_metadata_argument() }}) -> Tuple[rest_streaming{{ async_suffix }}.{{ async_method_name_prefix }}ResponseIterator, {{ client_method_metadata_type() }}]: {% endif %} + """Post-rpc interceptor for {{ method.name|snake_case }} + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the {{ service.name }} server but before it is returned to user code. + + We recommend only using this `post_{{ method.name|snake_case }}_with_metadata` + interceptor in new development instead of the `post_{{ method.name|snake_case }}` interceptor. + When both interceptors are used, this `post_{{ method.name|snake_case }}_with_metadata` interceptor runs after the + `post_{{ method.name|snake_case }}` interceptor. The (possibly modified) response returned by + `post_{{ method.name|snake_case }}` will be passed to + `post_{{ method.name|snake_case }}_with_metadata`. + """ + return response, metadata + + {% endif %}{# not method.void #} {% endfor %} {% for name, signature in api.mixin_api_signatures.items() %} diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 index 3ba65b993..63adba192 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2 @@ -256,6 +256,8 @@ class {{service.name}}RestTransport(_Base{{ service.name }}RestTransport): {% endif %}{# method.lro #} {#- TODO(https://github.com/googleapis/gapic-generator-python/issues/2274): Add debug log before intercepting a request #} resp = self._interceptor.post_{{ method.name|snake_case }}(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_{{ method.name|snake_case }}_with_metadata(resp, response_metadata) {# TODO(https://github.com/googleapis/gapic-generator-python/issues/2279): Add logging support for rest streaming. #} {% if not method.server_streaming %} if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER diff --git a/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest_asyncio.py.j2 b/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest_asyncio.py.j2 index 99658a0b1..79d54e4f2 100644 --- a/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest_asyncio.py.j2 +++ b/gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest_asyncio.py.j2 @@ -217,6 +217,8 @@ class Async{{service.name}}RestTransport(_Base{{ service.name }}RestTransport): json_format.Parse(content, pb_resp, ignore_unknown_fields=True) {% endif %}{# if method.server_streaming #} resp = await self._interceptor.post_{{ method.name|snake_case }}(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = await self._interceptor.post_{{ method.name|snake_case }}_with_metadata(resp, response_metadata) {# TODO(https://github.com/googleapis/gapic-generator-python/issues/2279): Add logging support for rest streaming. #} {% if not method.server_streaming %} if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER diff --git a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 index bd8547f63..33b76774c 100644 --- a/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 +++ b/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_macros.j2 @@ -2218,11 +2218,13 @@ def test_initialize_client_w_{{transport_name}}(): {% endif %} {% if not method.void %} mock.patch.object(transports.{{async_method_prefix}}{{ service.name }}RestInterceptor, "post_{{method.name|snake_case}}") as post, \ + mock.patch.object(transports.{{async_method_prefix}}{{ service.name }}RestInterceptor, "post_{{method.name|snake_case}}_with_metadata") as post_with_metadata, \ {% endif %} mock.patch.object(transports.{{async_method_prefix}}{{ service.name }}RestInterceptor, "pre_{{ method.name|snake_case }}") as pre: pre.assert_not_called() {% if not method.void %} post.assert_not_called() + post_with_metadata.assert_not_called() {% endif %} {% if method.input.ident.is_proto_plus_type %} pb_message = {{ method.input.ident }}.pb({{ method.input.ident }}()) @@ -2265,6 +2267,7 @@ def test_initialize_client_w_{{transport_name}}(): pre.return_value = request, metadata {% if not method.void %} post.return_value = {{ method.output.ident }}() + post_with_metadata.return_value = {{ method.output.ident }}(), metadata {% endif %} {{await_prefix}}client.{{ method_name }}(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) @@ -2272,6 +2275,7 @@ def test_initialize_client_w_{{transport_name}}(): pre.assert_called_once() {% if not method.void %} post.assert_called_once() + post_with_metadata.assert_called_once() {% endif %} {% endif %}{# end 'grpc' in transport #} {% endmacro%}{# inteceptor_class_test #} diff --git a/requirements.txt b/requirements.txt index 7397b03d6..eda186e27 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,103 +8,103 @@ aiohappyeyeballs==2.4.4 \ --hash=sha256:5fdd7d87889c63183afc18ce9271f9b0a7d32c2303e394468dd45d514a757745 \ --hash=sha256:a980909d50efcd44795c4afeca523296716d50cd756ddca6af8c65b996e27de8 # via aiohttp -aiohttp==3.11.9 \ - --hash=sha256:0411777249f25d11bd2964a230b3ffafcbed6cd65d0f2b132bc2b8f5b8c347c7 \ - --hash=sha256:0a97d657f6cf8782a830bb476c13f7d777cfcab8428ac49dde15c22babceb361 \ - --hash=sha256:0b5a5009b0159a8f707879dc102b139466d8ec6db05103ec1520394fdd8ea02c \ - --hash=sha256:0bcb7f6976dc0b6b56efde13294862adf68dd48854111b422a336fa729a82ea6 \ - --hash=sha256:14624d96f0d69cf451deed3173079a68c322279be6030208b045ab77e1e8d550 \ - --hash=sha256:15c4e489942d987d5dac0ba39e5772dcbed4cc9ae3710d1025d5ba95e4a5349c \ - --hash=sha256:176f8bb8931da0613bb0ed16326d01330066bb1e172dd97e1e02b1c27383277b \ - --hash=sha256:17af09d963fa1acd7e4c280e9354aeafd9e3d47eaa4a6bfbd2171ad7da49f0c5 \ - --hash=sha256:1a8b13b9950d8b2f8f58b6e5842c4b842b5887e2c32e3f4644d6642f1659a530 \ - --hash=sha256:202f40fb686e5f93908eee0c75d1e6fbe50a43e9bd4909bf3bf4a56b560ca180 \ - --hash=sha256:21cbe97839b009826a61b143d3ca4964c8590d7aed33d6118125e5b71691ca46 \ - --hash=sha256:27935716f8d62c1c73010428db310fd10136002cfc6d52b0ba7bdfa752d26066 \ - --hash=sha256:282e0a7ddd36ebc411f156aeaa0491e8fe7f030e2a95da532cf0c84b0b70bc66 \ - --hash=sha256:28f29bce89c3b401a53d6fd4bee401ee943083bf2bdc12ef297c1d63155070b0 \ - --hash=sha256:2ac9fd83096df36728da8e2f4488ac3b5602238f602706606f3702f07a13a409 \ - --hash=sha256:30f9f89ae625d412043f12ca3771b2ccec227cc93b93bb1f994db6e1af40a7d3 \ - --hash=sha256:317251b9c9a2f1a9ff9cd093775b34c6861d1d7df9439ce3d32a88c275c995cd \ - --hash=sha256:31de2f10f63f96cc19e04bd2df9549559beadd0b2ee2da24a17e7ed877ca8c60 \ - --hash=sha256:36df00e0541f264ce42d62280281541a47474dfda500bc5b7f24f70a7f87be7a \ - --hash=sha256:39625703540feb50b6b7f938b3856d1f4886d2e585d88274e62b1bd273fae09b \ - --hash=sha256:3f5461c77649358610fb9694e790956b4238ac5d9e697a17f63619c096469afe \ - --hash=sha256:4313f3bc901255b22f01663eeeae167468264fdae0d32c25fc631d5d6e15b502 \ - --hash=sha256:442356e8924fe1a121f8c87866b0ecdc785757fd28924b17c20493961b3d6697 \ - --hash=sha256:44cb1a1326a0264480a789e6100dc3e07122eb8cd1ad6b784a3d47d13ed1d89c \ - --hash=sha256:44d323aa80a867cb6db6bebb4bbec677c6478e38128847f2c6b0f70eae984d72 \ - --hash=sha256:499368eb904566fbdf1a3836a1532000ef1308f34a1bcbf36e6351904cced771 \ - --hash=sha256:4b01d9cfcb616eeb6d40f02e66bebfe7b06d9f2ef81641fdd50b8dd981166e0b \ - --hash=sha256:5720ebbc7a1b46c33a42d489d25d36c64c419f52159485e55589fbec648ea49a \ - --hash=sha256:5cc5e0d069c56645446c45a4b5010d4b33ac6c5ebfd369a791b5f097e46a3c08 \ - --hash=sha256:618b18c3a2360ac940a5503da14fa4f880c5b9bc315ec20a830357bcc62e6bae \ - --hash=sha256:6435a66957cdba1a0b16f368bde03ce9c79c57306b39510da6ae5312a1a5b2c1 \ - --hash=sha256:647ec5bee7e4ec9f1034ab48173b5fa970d9a991e565549b965e93331f1328fe \ - --hash=sha256:6e1e9e447856e9b7b3d38e1316ae9a8c92e7536ef48373de758ea055edfd5db5 \ - --hash=sha256:6ef1550bb5f55f71b97a6a395286db07f7f2c01c8890e613556df9a51da91e8d \ - --hash=sha256:6ffa45cc55b18d4ac1396d1ddb029f139b1d3480f1594130e62bceadf2e1a838 \ - --hash=sha256:77f31cebd8c27a36af6c7346055ac564946e562080ee1a838da724585c67474f \ - --hash=sha256:7a3b5b2c012d70c63d9d13c57ed1603709a4d9d7d473e4a9dfece0e4ea3d5f51 \ - --hash=sha256:7a7ddf981a0b953ade1c2379052d47ccda2f58ab678fca0671c7c7ca2f67aac2 \ - --hash=sha256:84de955314aa5e8d469b00b14d6d714b008087a0222b0f743e7ffac34ef56aff \ - --hash=sha256:8dcfd14c712aa9dd18049280bfb2f95700ff6a8bde645e09f17c3ed3f05a0130 \ - --hash=sha256:928f92f80e2e8d6567b87d3316c1fd9860ccfe36e87a9a7f5237d4cda8baa1ba \ - --hash=sha256:9384b07cfd3045b37b05ed002d1c255db02fb96506ad65f0f9b776b762a7572e \ - --hash=sha256:96726839a42429318017e67a42cca75d4f0d5248a809b3cc2e125445edd7d50d \ - --hash=sha256:96bbec47beb131bbf4bae05d8ef99ad9e5738f12717cfbbf16648b78b0232e87 \ - --hash=sha256:9bcf97b971289be69638d8b1b616f7e557e1342debc7fc86cf89d3f08960e411 \ - --hash=sha256:a0cf4d814689e58f57ecd5d8c523e6538417ca2e72ff52c007c64065cef50fb2 \ - --hash=sha256:a7c6147c6306f537cff59409609508a1d2eff81199f0302dd456bb9e7ea50c39 \ - --hash=sha256:a9266644064779840feec0e34f10a89b3ff1d2d6b751fe90017abcad1864fa7c \ - --hash=sha256:afbe85b50ade42ddff5669947afde9e8a610e64d2c80be046d67ec4368e555fa \ - --hash=sha256:afcda759a69c6a8be3aae764ec6733155aa4a5ad9aad4f398b52ba4037942fe3 \ - --hash=sha256:b2fab23003c4bb2249729a7290a76c1dda38c438300fdf97d4e42bf78b19c810 \ - --hash=sha256:bd3f711f4c99da0091ced41dccdc1bcf8be0281dc314d6d9c6b6cf5df66f37a9 \ - --hash=sha256:be0c7c98e38a1e3ad7a6ff64af8b6d6db34bf5a41b1478e24c3c74d9e7f8ed42 \ - --hash=sha256:c1f2d7fd583fc79c240094b3e7237d88493814d4b300d013a42726c35a734bc9 \ - --hash=sha256:c5bba6b83fde4ca233cfda04cbd4685ab88696b0c8eaf76f7148969eab5e248a \ - --hash=sha256:c6beeac698671baa558e82fa160be9761cf0eb25861943f4689ecf9000f8ebd0 \ - --hash=sha256:c7333e7239415076d1418dbfb7fa4df48f3a5b00f8fdf854fca549080455bc14 \ - --hash=sha256:c8a02f74ae419e3955af60f570d83187423e42e672a6433c5e292f1d23619269 \ - --hash=sha256:c9c23e62f3545c2216100603614f9e019e41b9403c47dd85b8e7e5015bf1bde0 \ - --hash=sha256:cca505829cdab58c2495ff418c96092d225a1bbd486f79017f6de915580d3c44 \ - --hash=sha256:d3108f0ad5c6b6d78eec5273219a5bbd884b4aacec17883ceefaac988850ce6e \ - --hash=sha256:d4b8a1b6c7a68c73191f2ebd3bf66f7ce02f9c374e309bdb68ba886bbbf1b938 \ - --hash=sha256:d6e274661c74195708fc4380a4ef64298926c5a50bb10fbae3d01627d7a075b7 \ - --hash=sha256:db2914de2559809fdbcf3e48f41b17a493b58cb7988d3e211f6b63126c55fe82 \ - --hash=sha256:e738aabff3586091221044b7a584865ddc4d6120346d12e28e788307cd731043 \ - --hash=sha256:e7f6173302f8a329ca5d1ee592af9e628d3ade87816e9958dcf7cdae2841def7 \ - --hash=sha256:e9d036a9a41fc78e8a3f10a86c2fc1098fca8fab8715ba9eb999ce4788d35df0 \ - --hash=sha256:ea142255d4901b03f89cb6a94411ecec117786a76fc9ab043af8f51dd50b5313 \ - --hash=sha256:ebd3e6b0c7d4954cca59d241970011f8d3327633d555051c430bd09ff49dc494 \ - --hash=sha256:ec656680fc53a13f849c71afd0c84a55c536206d524cbc831cde80abbe80489e \ - --hash=sha256:ec8df0ff5a911c6d21957a9182402aad7bf060eaeffd77c9ea1c16aecab5adbf \ - --hash=sha256:ed95d66745f53e129e935ad726167d3a6cb18c5d33df3165974d54742c373868 \ - --hash=sha256:ef2c9499b7bd1e24e473dc1a85de55d72fd084eea3d8bdeec7ee0720decb54fa \ - --hash=sha256:f5252ba8b43906f206048fa569debf2cd0da0316e8d5b4d25abe53307f573941 \ - --hash=sha256:f737fef6e117856400afee4f17774cdea392b28ecf058833f5eca368a18cf1bf \ - --hash=sha256:fc726c3fa8f606d07bd2b500e5dc4c0fd664c59be7788a16b9e34352c50b6b6b +aiohttp==3.11.10 \ + --hash=sha256:012f176945af138abc10c4a48743327a92b4ca9adc7a0e078077cdb5dbab7be0 \ + --hash=sha256:02c13415b5732fb6ee7ff64583a5e6ed1c57aa68f17d2bda79c04888dfdc2769 \ + --hash=sha256:03b6002e20938fc6ee0918c81d9e776bebccc84690e2b03ed132331cca065ee5 \ + --hash=sha256:04814571cb72d65a6899db6099e377ed00710bf2e3eafd2985166f2918beaf59 \ + --hash=sha256:0580f2e12de2138f34debcd5d88894786453a76e98febaf3e8fe5db62d01c9bf \ + --hash=sha256:06a8e2ee1cbac16fe61e51e0b0c269400e781b13bcfc33f5425912391a542985 \ + --hash=sha256:076bc454a7e6fd646bc82ea7f98296be0b1219b5e3ef8a488afbdd8e81fbac50 \ + --hash=sha256:0c9527819b29cd2b9f52033e7fb9ff08073df49b4799c89cb5754624ecd98299 \ + --hash=sha256:0dc49f42422163efb7e6f1df2636fe3db72713f6cd94688e339dbe33fe06d61d \ + --hash=sha256:14cdb5a9570be5a04eec2ace174a48ae85833c2aadc86de68f55541f66ce42ab \ + --hash=sha256:15fccaf62a4889527539ecb86834084ecf6e9ea70588efde86e8bc775e0e7542 \ + --hash=sha256:24213ba85a419103e641e55c27dc7ff03536c4873470c2478cce3311ba1eee7b \ + --hash=sha256:31d5093d3acd02b31c649d3a69bb072d539d4c7659b87caa4f6d2bcf57c2fa2b \ + --hash=sha256:3691ed7726fef54e928fe26344d930c0c8575bc968c3e239c2e1a04bd8cf7838 \ + --hash=sha256:386fbe79863eb564e9f3615b959e28b222259da0c48fd1be5929ac838bc65683 \ + --hash=sha256:3bbbfff4c679c64e6e23cb213f57cc2c9165c9a65d63717108a644eb5a7398df \ + --hash=sha256:3de34936eb1a647aa919655ff8d38b618e9f6b7f250cc19a57a4bf7fd2062b6d \ + --hash=sha256:40d1c7a7f750b5648642586ba7206999650208dbe5afbcc5284bcec6579c9b91 \ + --hash=sha256:44224d815853962f48fe124748227773acd9686eba6dc102578defd6fc99e8d9 \ + --hash=sha256:47ad15a65fb41c570cd0ad9a9ff8012489e68176e7207ec7b82a0940dddfd8be \ + --hash=sha256:482cafb7dc886bebeb6c9ba7925e03591a62ab34298ee70d3dd47ba966370d2c \ + --hash=sha256:49c7dbbc1a559ae14fc48387a115b7d4bbc84b4a2c3b9299c31696953c2a5219 \ + --hash=sha256:4b2c7ac59c5698a7a8207ba72d9e9c15b0fc484a560be0788b31312c2c5504e4 \ + --hash=sha256:4cca22a61b7fe45da8fc73c3443150c3608750bbe27641fc7558ec5117b27fdf \ + --hash=sha256:4cfce37f31f20800a6a6620ce2cdd6737b82e42e06e6e9bd1b36f546feb3c44f \ + --hash=sha256:502a1464ccbc800b4b1995b302efaf426e8763fadf185e933c2931df7db9a199 \ + --hash=sha256:53bf2097e05c2accc166c142a2090e4c6fd86581bde3fd9b2d3f9e93dda66ac1 \ + --hash=sha256:593c114a2221444f30749cc5e5f4012488f56bd14de2af44fe23e1e9894a9c60 \ + --hash=sha256:5d6958671b296febe7f5f859bea581a21c1d05430d1bbdcf2b393599b1cdce77 \ + --hash=sha256:5ef359ebc6949e3a34c65ce20230fae70920714367c63afd80ea0c2702902ccf \ + --hash=sha256:613e5169f8ae77b1933e42e418a95931fb4867b2991fc311430b15901ed67079 \ + --hash=sha256:61b9bae80ed1f338c42f57c16918853dc51775fb5cb61da70d590de14d8b5fb4 \ + --hash=sha256:6362cc6c23c08d18ddbf0e8c4d5159b5df74fea1a5278ff4f2c79aed3f4e9f46 \ + --hash=sha256:65a96e3e03300b41f261bbfd40dfdbf1c301e87eab7cd61c054b1f2e7c89b9e8 \ + --hash=sha256:65e55ca7debae8faaffee0ebb4b47a51b4075f01e9b641c31e554fd376595c6c \ + --hash=sha256:68386d78743e6570f054fe7949d6cb37ef2b672b4d3405ce91fafa996f7d9b4d \ + --hash=sha256:68ff6f48b51bd78ea92b31079817aff539f6c8fc80b6b8d6ca347d7c02384e33 \ + --hash=sha256:6ab29b8a0beb6f8eaf1e5049252cfe74adbaafd39ba91e10f18caeb0e99ffb34 \ + --hash=sha256:77ae58586930ee6b2b6f696c82cf8e78c8016ec4795c53e36718365f6959dc82 \ + --hash=sha256:77c4aa15a89847b9891abf97f3d4048f3c2d667e00f8a623c89ad2dccee6771b \ + --hash=sha256:78153314f26d5abef3239b4a9af20c229c6f3ecb97d4c1c01b22c4f87669820c \ + --hash=sha256:7852bbcb4d0d2f0c4d583f40c3bc750ee033265d80598d0f9cb6f372baa6b836 \ + --hash=sha256:7e97d622cb083e86f18317282084bc9fbf261801b0192c34fe4b1febd9f7ae69 \ + --hash=sha256:7f3dc0e330575f5b134918976a645e79adf333c0a1439dcf6899a80776c9ab39 \ + --hash=sha256:80886dac673ceaef499de2f393fc80bb4481a129e6cb29e624a12e3296cc088f \ + --hash=sha256:811f23b3351ca532af598405db1093f018edf81368e689d1b508c57dcc6b6a32 \ + --hash=sha256:86a5dfcc39309470bd7b68c591d84056d195428d5d2e0b5ccadfbaf25b026ebc \ + --hash=sha256:8b3cf2dc0f0690a33f2d2b2cb15db87a65f1c609f53c37e226f84edb08d10f52 \ + --hash=sha256:8cc5203b817b748adccb07f36390feb730b1bc5f56683445bfe924fc270b8816 \ + --hash=sha256:909af95a72cedbefe5596f0bdf3055740f96c1a4baa0dd11fd74ca4de0b4e3f1 \ + --hash=sha256:974d3a2cce5fcfa32f06b13ccc8f20c6ad9c51802bb7f829eae8a1845c4019ec \ + --hash=sha256:98283b94cc0e11c73acaf1c9698dea80c830ca476492c0fe2622bd931f34b487 \ + --hash=sha256:98f5635f7b74bcd4f6f72fcd85bea2154b323a9f05226a80bc7398d0c90763b0 \ + --hash=sha256:99b7920e7165be5a9e9a3a7f1b680f06f68ff0d0328ff4079e5163990d046767 \ + --hash=sha256:9bca390cb247dbfaec3c664326e034ef23882c3f3bfa5fbf0b56cad0320aaca5 \ + --hash=sha256:9e2e576caec5c6a6b93f41626c9c02fc87cd91538b81a3670b2e04452a63def6 \ + --hash=sha256:9ef405356ba989fb57f84cac66f7b0260772836191ccefbb987f414bcd2979d9 \ + --hash=sha256:a55d2ad345684e7c3dd2c20d2f9572e9e1d5446d57200ff630e6ede7612e307f \ + --hash=sha256:ab7485222db0959a87fbe8125e233b5a6f01f4400785b36e8a7878170d8c3138 \ + --hash=sha256:b1fc6b45010a8d0ff9e88f9f2418c6fd408c99c211257334aff41597ebece42e \ + --hash=sha256:b78f053a7ecfc35f0451d961dacdc671f4bcbc2f58241a7c820e9d82559844cf \ + --hash=sha256:b99acd4730ad1b196bfb03ee0803e4adac371ae8efa7e1cbc820200fc5ded109 \ + --hash=sha256:be2b516f56ea883a3e14dda17059716593526e10fb6303189aaf5503937db408 \ + --hash=sha256:beb39a6d60a709ae3fb3516a1581777e7e8b76933bb88c8f4420d875bb0267c6 \ + --hash=sha256:bf3d1a519a324af764a46da4115bdbd566b3c73fb793ffb97f9111dbc684fc4d \ + --hash=sha256:c49a76c1038c2dd116fa443eba26bbb8e6c37e924e2513574856de3b6516be99 \ + --hash=sha256:c5532f0441fc09c119e1dca18fbc0687e64fbeb45aa4d6a87211ceaee50a74c4 \ + --hash=sha256:c6b9e6d7e41656d78e37ce754813fa44b455c3d0d0dced2a047def7dc5570b74 \ + --hash=sha256:c87bf31b7fdab94ae3adbe4a48e711bfc5f89d21cf4c197e75561def39e223bc \ + --hash=sha256:cbad88a61fa743c5d283ad501b01c153820734118b65aee2bd7dbb735475ce0d \ + --hash=sha256:cf14627232dfa8730453752e9cdc210966490992234d77ff90bc8dc0dce361d5 \ + --hash=sha256:db1d0b28fcb7f1d35600150c3e4b490775251dea70f894bf15c678fdd84eda6a \ + --hash=sha256:ddf5f7d877615f6a1e75971bfa5ac88609af3b74796ff3e06879e8422729fd01 \ + --hash=sha256:e44a9a3c053b90c6f09b1bb4edd880959f5328cf63052503f892c41ea786d99f \ + --hash=sha256:efb15a17a12497685304b2d976cb4939e55137df7b09fa53f1b6a023f01fcb4e \ + --hash=sha256:fbbaea811a2bba171197b08eea288b9402faa2bab2ba0858eecdd0a4105753a3 # via -r requirements.in -aiosignal==1.3.1 \ - --hash=sha256:54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc \ - --hash=sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17 +aiosignal==1.3.2 \ + --hash=sha256:45cde58e409a301715980c2b01d0c28bdde3770d8290b5eb2173759d9acb31a5 \ + --hash=sha256:a8c255c66fafb1e499c9351d0bf32ff2d8a0321595ebac3b93713656d2436f54 # via aiohttp async-timeout==5.0.1 \ --hash=sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c \ --hash=sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3 # via aiohttp -attrs==24.2.0 \ - --hash=sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346 \ - --hash=sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2 +attrs==24.3.0 \ + --hash=sha256:8f5c07333d543103541ba7be0e2ce16eeee8130cb0b3f9238ab904ce1e85baff \ + --hash=sha256:ac96cd038792094f438ad1f6ff80837353805ac950cd2aa0e0625ef19850c308 # via aiohttp cachetools==5.5.0 \ --hash=sha256:02134e8439cdc2ffb62023ce1debca2944c3f289d66bb17ead3ab3dede74b292 \ --hash=sha256:2cc24fb4cbe39633fb7badd9db9ca6295d766d9c2995f245725a46715d050f2a # via google-auth -certifi==2024.8.30 \ - --hash=sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8 \ - --hash=sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9 +certifi==2024.12.14 \ + --hash=sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56 \ + --hash=sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db # via requests charset-normalizer==3.4.0 \ --hash=sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621 \ @@ -317,13 +317,13 @@ frozenlist==1.5.0 \ # via # aiohttp # aiosignal -google-api-core==2.23.0 \ - --hash=sha256:2ceb087315e6af43f256704b871d99326b1f12a9d6ce99beaedec99ba26a0ace \ - --hash=sha256:c20100d4c4c41070cf365f1d8ddf5365915291b5eb11b83829fbd1c999b5122f +google-api-core==2.24.0 \ + --hash=sha256:10d82ac0fca69c82a25b3efdeefccf6f28e02ebb97925a8cce8edbfe379929d9 \ + --hash=sha256:e255640547a597a4da010876d333208ddac417d60add22b6851a0c66a831fcaf # via -r requirements.in -google-auth==2.36.0 \ - --hash=sha256:51a15d47028b66fd36e5c64a82d2d57480075bccc7da37cde257fc94177a61fb \ - --hash=sha256:545e9618f2df0bcbb7dcbc45a546485b1212624716975a1ea5ae8149ce769ab1 +google-auth==2.37.0 \ + --hash=sha256:0054623abf1f9c83492c63d3f47e77f0a544caa3d40b2d98e099a611c2dd5d00 \ + --hash=sha256:42664f18290a6be591be5329a96fe30184be1a1badb7292a7f686a9659de9ca0 # via google-api-core googleapis-common-protos[grpc]==1.66.0 \ --hash=sha256:c3e7b33d15fdca5374cc0a7346dd92ffa847425cc4ea941d970f13680052ec8c \ @@ -336,62 +336,62 @@ grpc-google-iam-v1==0.13.1 \ --hash=sha256:3ff4b2fd9d990965e410965253c0da6f66205d5a8291c4c31c6ebecca18a9001 \ --hash=sha256:c3e86151a981811f30d5e7330f271cee53e73bb87755e88cc3b6f0c7b5fe374e # via -r requirements.in -grpcio==1.68.0 \ - --hash=sha256:0d230852ba97654453d290e98d6aa61cb48fa5fafb474fb4c4298d8721809354 \ - --hash=sha256:0efbbd849867e0e569af09e165363ade75cf84f5229b2698d53cf22c7a4f9e21 \ - --hash=sha256:14331e5c27ed3545360464a139ed279aa09db088f6e9502e95ad4bfa852bb116 \ - --hash=sha256:15327ab81131ef9b94cb9f45b5bd98803a179c7c61205c8c0ac9aff9d6c4e82a \ - --hash=sha256:15377bce516b1c861c35e18eaa1c280692bf563264836cece693c0f169b48829 \ - --hash=sha256:15fa1fe25d365a13bc6d52fcac0e3ee1f9baebdde2c9b3b2425f8a4979fccea1 \ - --hash=sha256:18668e36e7f4045820f069997834e94e8275910b1f03e078a6020bd464cb2363 \ - --hash=sha256:2af76ab7c427aaa26aa9187c3e3c42f38d3771f91a20f99657d992afada2294a \ - --hash=sha256:2bddd04a790b69f7a7385f6a112f46ea0b34c4746f361ebafe9ca0be567c78e9 \ - --hash=sha256:32a9cb4686eb2e89d97022ecb9e1606d132f85c444354c17a7dbde4a455e4a3b \ - --hash=sha256:3ac7f10850fd0487fcce169c3c55509101c3bde2a3b454869639df2176b60a03 \ - --hash=sha256:3b2b559beb2d433129441783e5f42e3be40a9e1a89ec906efabf26591c5cd415 \ - --hash=sha256:4028b8e9a3bff6f377698587d642e24bd221810c06579a18420a17688e421af7 \ - --hash=sha256:44bcbebb24363d587472089b89e2ea0ab2e2b4df0e4856ba4c0b087c82412121 \ - --hash=sha256:46a2d74d4dd8993151c6cd585594c082abe74112c8e4175ddda4106f2ceb022f \ - --hash=sha256:4df81d78fd1646bf94ced4fb4cd0a7fe2e91608089c522ef17bc7db26e64effd \ - --hash=sha256:4e300e6978df0b65cc2d100c54e097c10dfc7018b9bd890bbbf08022d47f766d \ - --hash=sha256:4f1931c7aa85be0fa6cea6af388e576f3bf6baee9e5d481c586980c774debcb4 \ - --hash=sha256:50992f214264e207e07222703c17d9cfdcc2c46ed5a1ea86843d440148ebbe10 \ - --hash=sha256:55d3b52fd41ec5772a953612db4e70ae741a6d6ed640c4c89a64f017a1ac02b5 \ - --hash=sha256:5a180328e92b9a0050958ced34dddcb86fec5a8b332f5a229e353dafc16cd332 \ - --hash=sha256:619b5d0f29f4f5351440e9343224c3e19912c21aeda44e0c49d0d147a8d01544 \ - --hash=sha256:6b2f98165ea2790ea159393a2246b56f580d24d7da0d0342c18a085299c40a75 \ - --hash=sha256:6f9c7ad1a23e1047f827385f4713b5b8c6c7d325705be1dd3e31fb00dcb2f665 \ - --hash=sha256:79f81b7fbfb136247b70465bd836fa1733043fdee539cd6031cb499e9608a110 \ - --hash=sha256:7e0a3e72c0e9a1acab77bef14a73a416630b7fd2cbd893c0a873edc47c42c8cd \ - --hash=sha256:7e7483d39b4a4fddb9906671e9ea21aaad4f031cdfc349fec76bdfa1e404543a \ - --hash=sha256:88fb2925789cfe6daa20900260ef0a1d0a61283dfb2d2fffe6194396a354c618 \ - --hash=sha256:8af6137cc4ae8e421690d276e7627cfc726d4293f6607acf9ea7260bd8fc3d7d \ - --hash=sha256:8b0ff09c81e3aded7a183bc6473639b46b6caa9c1901d6f5e2cba24b95e59e30 \ - --hash=sha256:8c73f9fbbaee1a132487e31585aa83987ddf626426d703ebcb9a528cf231c9b1 \ - --hash=sha256:99f06232b5c9138593ae6f2e355054318717d32a9c09cdc5a2885540835067a1 \ - --hash=sha256:9fe1b141cda52f2ca73e17d2d3c6a9f3f3a0c255c216b50ce616e9dca7e3441d \ - --hash=sha256:a17278d977746472698460c63abf333e1d806bd41f2224f90dbe9460101c9796 \ - --hash=sha256:a59f5822f9459bed098ffbceb2713abbf7c6fd13f2b9243461da5c338d0cd6c3 \ - --hash=sha256:a6213d2f7a22c3c30a479fb5e249b6b7e648e17f364598ff64d08a5136fe488b \ - --hash=sha256:a831dcc343440969aaa812004685ed322cdb526cd197112d0db303b0da1e8659 \ - --hash=sha256:afbf45a62ba85a720491bfe9b2642f8761ff348006f5ef67e4622621f116b04a \ - --hash=sha256:b0cf343c6f4f6aa44863e13ec9ddfe299e0be68f87d68e777328bff785897b05 \ - --hash=sha256:c03d89df516128febc5a7e760d675b478ba25802447624edf7aa13b1e7b11e2a \ - --hash=sha256:c1245651f3c9ea92a2db4f95d37b7597db6b246d5892bca6ee8c0e90d76fb73c \ - --hash=sha256:cc5f0a4f5904b8c25729a0498886b797feb817d1fd3812554ffa39551112c161 \ - --hash=sha256:dba037ff8d284c8e7ea9a510c8ae0f5b016004f13c3648f72411c464b67ff2fb \ - --hash=sha256:def1a60a111d24376e4b753db39705adbe9483ef4ca4761f825639d884d5da78 \ - --hash=sha256:e0d2f68eaa0a755edd9a47d40e50dba6df2bceda66960dee1218da81a2834d27 \ - --hash=sha256:e0d30f3fee9372796f54d3100b31ee70972eaadcc87314be369360248a3dcffe \ - --hash=sha256:e18589e747c1e70b60fab6767ff99b2d0c359ea1db8a2cb524477f93cdbedf5b \ - --hash=sha256:e1e7ed311afb351ff0d0e583a66fcb39675be112d61e7cfd6c8269884a98afbc \ - --hash=sha256:e46541de8425a4d6829ac6c5d9b16c03c292105fe9ebf78cb1c31e8d242f9155 \ - --hash=sha256:e694b5928b7b33ca2d3b4d5f9bf8b5888906f181daff6b406f4938f3a997a490 \ - --hash=sha256:f60fa2adf281fd73ae3a50677572521edca34ba373a45b457b5ebe87c2d01e1d \ - --hash=sha256:f84890b205692ea813653ece4ac9afa2139eae136e419231b0eec7c39fdbe4c2 \ - --hash=sha256:f8f695d9576ce836eab27ba7401c60acaf9ef6cf2f70dfe5462055ba3df02cc3 \ - --hash=sha256:fc05759ffbd7875e0ff2bd877be1438dfe97c9312bbc558c8284a9afa1d0f40e \ - --hash=sha256:fd2c2d47969daa0e27eadaf15c13b5e92605c5e5953d23c06d0b5239a2f176d3 +grpcio==1.68.1 \ + --hash=sha256:025f790c056815b3bf53da850dd70ebb849fd755a4b1ac822cb65cd631e37d43 \ + --hash=sha256:04cfd68bf4f38f5bb959ee2361a7546916bd9a50f78617a346b3aeb2b42e2161 \ + --hash=sha256:0feb02205a27caca128627bd1df4ee7212db051019a9afa76f4bb6a1a80ca95e \ + --hash=sha256:1098f03dedc3b9810810568060dea4ac0822b4062f537b0f53aa015269be0a76 \ + --hash=sha256:12941d533f3cd45d46f202e3667be8ebf6bcb3573629c7ec12c3e211d99cfccf \ + --hash=sha256:255b1635b0ed81e9f91da4fcc8d43b7ea5520090b9a9ad9340d147066d1d3613 \ + --hash=sha256:298ee7f80e26f9483f0b6f94cc0a046caf54400a11b644713bb5b3d8eb387600 \ + --hash=sha256:2c4cec6177bf325eb6faa6bd834d2ff6aa8bb3b29012cceb4937b86f8b74323c \ + --hash=sha256:2cc1fd04af8399971bcd4f43bd98c22d01029ea2e56e69c34daf2bf8470e47f5 \ + --hash=sha256:334ab917792904245a028f10e803fcd5b6f36a7b2173a820c0b5b076555825e1 \ + --hash=sha256:3522c77d7e6606d6665ec8d50e867f13f946a4e00c7df46768f1c85089eae515 \ + --hash=sha256:37ea3be171f3cf3e7b7e412a98b77685eba9d4fd67421f4a34686a63a65d99f9 \ + --hash=sha256:390eee4225a661c5cd133c09f5da1ee3c84498dc265fd292a6912b65c421c78c \ + --hash=sha256:3aed6544e4d523cd6b3119b0916cef3d15ef2da51e088211e4d1eb91a6c7f4f1 \ + --hash=sha256:3ceb56c4285754e33bb3c2fa777d055e96e6932351a3082ce3559be47f8024f0 \ + --hash=sha256:44a8502dd5de653ae6a73e2de50a401d84184f0331d0ac3daeb044e66d5c5054 \ + --hash=sha256:4b177f5547f1b995826ef529d2eef89cca2f830dd8b2c99ffd5fde4da734ba73 \ + --hash=sha256:4efac5481c696d5cb124ff1c119a78bddbfdd13fc499e3bc0ca81e95fc573684 \ + --hash=sha256:52fbf85aa71263380d330f4fce9f013c0798242e31ede05fcee7fbe40ccfc20d \ + --hash=sha256:55857c71641064f01ff0541a1776bfe04a59db5558e82897d35a7793e525774c \ + --hash=sha256:66a24f3d45c33550703f0abb8b656515b0ab777970fa275693a2f6dc8e35f1c1 \ + --hash=sha256:6ab2d912ca39c51f46baf2a0d92aa265aa96b2443266fc50d234fa88bf877d8e \ + --hash=sha256:77d65165fc35cff6e954e7fd4229e05ec76102d4406d4576528d3a3635fc6172 \ + --hash=sha256:7dfc914cc31c906297b30463dde0b9be48e36939575eaf2a0a22a8096e69afe5 \ + --hash=sha256:7f20ebec257af55694d8f993e162ddf0d36bd82d4e57f74b31c67b3c6d63d8b2 \ + --hash=sha256:80af6f1e69c5e68a2be529990684abdd31ed6622e988bf18850075c81bb1ad6e \ + --hash=sha256:83bbf5807dc3ee94ce1de2dfe8a356e1d74101e4b9d7aa8c720cc4818a34aded \ + --hash=sha256:8720c25cd9ac25dd04ee02b69256d0ce35bf8a0f29e20577427355272230965a \ + --hash=sha256:8829924fffb25386995a31998ccbbeaa7367223e647e0122043dfc485a87c666 \ + --hash=sha256:8a3869a6661ec8f81d93f4597da50336718bde9eb13267a699ac7e0a1d6d0bea \ + --hash=sha256:8cb620037a2fd9eeee97b4531880e439ebfcd6d7d78f2e7dcc3726428ab5ef63 \ + --hash=sha256:919d7f18f63bcad3a0f81146188e90274fde800a94e35d42ffe9eadf6a9a6330 \ + --hash=sha256:95c87ce2a97434dffe7327a4071839ab8e8bffd0054cc74cbe971fba98aedd60 \ + --hash=sha256:963cc8d7d79b12c56008aabd8b457f400952dbea8997dd185f155e2f228db079 \ + --hash=sha256:96f473cdacfdd506008a5d7579c9f6a7ff245a9ade92c3c0265eb76cc591914f \ + --hash=sha256:9d1fae6bbf0816415b81db1e82fb3bf56f7857273c84dcbe68cbe046e58e1ccd \ + --hash=sha256:a0c8ddabef9c8f41617f213e527254c41e8b96ea9d387c632af878d05db9229c \ + --hash=sha256:a1b988b40f2fd9de5c820f3a701a43339d8dcf2cb2f1ca137e2c02671cc83ac1 \ + --hash=sha256:a47faedc9ea2e7a3b6569795c040aae5895a19dde0c728a48d3c5d7995fda385 \ + --hash=sha256:a8040f85dcb9830d8bbb033ae66d272614cec6faceee88d37a88a9bd1a7a704e \ + --hash=sha256:b33bd114fa5a83f03ec6b7b262ef9f5cac549d4126f1dc702078767b10c46ed9 \ + --hash=sha256:c08079b4934b0bf0a8847f42c197b1d12cba6495a3d43febd7e99ecd1cdc8d54 \ + --hash=sha256:c28848761a6520c5c6071d2904a18d339a796ebe6b800adc8b3f474c5ce3c3ad \ + --hash=sha256:cb400138e73969eb5e0535d1d06cae6a6f7a15f2cc74add320e2130b8179211a \ + --hash=sha256:cbb5780e2e740b6b4f2d208e90453591036ff80c02cc605fea1af8e6fc6b1bbe \ + --hash=sha256:ccf2ebd2de2d6661e2520dae293298a3803a98ebfc099275f113ce1f6c2a80f1 \ + --hash=sha256:d35740e3f45f60f3c37b1e6f2f4702c23867b9ce21c6410254c9c682237da68d \ + --hash=sha256:d99abcd61760ebb34bdff37e5a3ba333c5cc09feda8c1ad42547bea0416ada78 \ + --hash=sha256:ddda1aa22495d8acd9dfbafff2866438d12faec4d024ebc2e656784d96328ad0 \ + --hash=sha256:dffd29a2961f3263a16d73945b57cd44a8fd0b235740cb14056f0612329b345e \ + --hash=sha256:e4842e4872ae4ae0f5497bf60a0498fa778c192cc7a9e87877abd2814aca9475 \ + --hash=sha256:e8dbe3e00771bfe3d04feed8210fc6617006d06d9a2679b74605b9fed3e8362c \ + --hash=sha256:ee2e743e51cb964b4975de572aa8fb95b633f496f9fcb5e257893df3be854746 \ + --hash=sha256:eeb38ff04ab6e5756a2aef6ad8d94e89bb4a51ef96e20f45c44ba190fa0bcaad \ + --hash=sha256:f8261fa2a5f679abeb2a0a93ad056d765cdca1c47745eda3f2d87f874ff4b8c9 # via # googleapis-common-protos # grpc-google-iam-v1 @@ -717,18 +717,18 @@ proto-plus==1.25.0 \ # via # -r requirements.in # google-api-core -protobuf==5.29.0 \ - --hash=sha256:0cd67a1e5c2d88930aa767f702773b2d054e29957432d7c6a18f8be02a07719a \ - --hash=sha256:0d10091d6d03537c3f902279fcf11e95372bdd36a79556311da0487455791b20 \ - --hash=sha256:17d128eebbd5d8aee80300aed7a43a48a25170af3337f6f1333d1fac2c6839ac \ - --hash=sha256:34a90cf30c908f47f40ebea7811f743d360e202b6f10d40c02529ebd84afc069 \ - --hash=sha256:445a0c02483869ed8513a585d80020d012c6dc60075f96fa0563a724987b1001 \ - --hash=sha256:6c3009e22717c6cc9e6594bb11ef9f15f669b19957ad4087214d69e08a213368 \ - --hash=sha256:85286a47caf63b34fa92fdc1fd98b649a8895db595cfa746c5286eeae890a0b1 \ - --hash=sha256:88c4af76a73183e21061881360240c0cdd3c39d263b4e8fb570aaf83348d608f \ - --hash=sha256:c931c61d0cc143a2e756b1e7f8197a508de5365efd40f83c907a9febf36e6b43 \ - --hash=sha256:e467f81fdd12ded9655cea3e9b83dc319d93b394ce810b556fb0f421d8613e86 \ - --hash=sha256:ea7fb379b257911c8c020688d455e8f74efd2f734b72dc1ea4b4d7e9fd1326f2 +protobuf==5.29.2 \ + --hash=sha256:13d6d617a2a9e0e82a88113d7191a1baa1e42c2cc6f5f1398d3b054c8e7e714a \ + --hash=sha256:2d2e674c58a06311c8e99e74be43e7f3a8d1e2b2fdf845eaa347fbd866f23355 \ + --hash=sha256:36000f97ea1e76e8398a3f02936aac2a5d2b111aae9920ec1b769fc4a222c4d9 \ + --hash=sha256:494229ecd8c9009dd71eda5fd57528395d1eacdf307dbece6c12ad0dd09e912e \ + --hash=sha256:842de6d9241134a973aab719ab42b008a18a90f9f07f06ba480df268f86432f9 \ + --hash=sha256:a0c53d78383c851bfa97eb42e3703aefdc96d2036a41482ffd55dc5f529466eb \ + --hash=sha256:b2cc8e8bb7c9326996f0e160137b0861f1a82162502658df2951209d0cb0309e \ + --hash=sha256:b6b0d416bbbb9d4fbf9d0561dbfc4e324fd522f61f7af0fe0f282ab67b22477e \ + --hash=sha256:c12ba8249f5624300cf51c3d0bfe5be71a60c63e4dcf51ffe9a68771d958c851 \ + --hash=sha256:e621a98c0201a7c8afe89d9646859859be97cb22b8bf1d8eacfd90d5bda2eb19 \ + --hash=sha256:fde4554c0e578a5a0bcc9a276339594848d1e89f9ea47b4427c80e5d72f90181 # via # -r requirements.in # google-api-core @@ -753,9 +753,9 @@ pytest==8.3.4 \ --hash=sha256:50e16d954148559c9a74109af1eaf0c945ba2d8f30f0a3d3335edde19788b6f6 \ --hash=sha256:965370d062bce11e73868e0335abac31b4d3de0e82f4007408d242b4f8610761 # via pytest-asyncio -pytest-asyncio==0.24.0 \ - --hash=sha256:a811296ed596b69bf0b6f3dc40f83bcaf341b155a269052d82efa2b25ac7037b \ - --hash=sha256:d081d828e576d85f875399194281e92bf8a68d60d72d1a2faf2feddb6c46b276 +pytest-asyncio==0.25.0 \ + --hash=sha256:8c0610303c9e0442a5db8604505fc0f545456ba1528824842b37b4a626cbf609 \ + --hash=sha256:db5432d18eac6b7e28b46dcd9b69921b55c3b1086e85febfe04e70b18d9e81b3 # via -r requirements.in pyyaml==6.0.2 \ --hash=sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff \ diff --git a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/rest.py b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/rest.py index 053297f16..f222a8a46 100755 --- a/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/rest.py +++ b/tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/rest.py @@ -268,12 +268,31 @@ def pre_analyze_iam_policy(self, request: asset_service.AnalyzeIamPolicyRequest, def post_analyze_iam_policy(self, response: asset_service.AnalyzeIamPolicyResponse) -> asset_service.AnalyzeIamPolicyResponse: """Post-rpc interceptor for analyze_iam_policy - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_analyze_iam_policy_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_analyze_iam_policy` interceptor runs + before the `post_analyze_iam_policy_with_metadata` interceptor. """ return response + def post_analyze_iam_policy_with_metadata(self, response: asset_service.AnalyzeIamPolicyResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.AnalyzeIamPolicyResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for analyze_iam_policy + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_analyze_iam_policy_with_metadata` + interceptor in new development instead of the `post_analyze_iam_policy` interceptor. + When both interceptors are used, this `post_analyze_iam_policy_with_metadata` interceptor runs after the + `post_analyze_iam_policy` interceptor. The (possibly modified) response returned by + `post_analyze_iam_policy` will be passed to + `post_analyze_iam_policy_with_metadata`. + """ + return response, metadata + def pre_analyze_iam_policy_longrunning(self, request: asset_service.AnalyzeIamPolicyLongrunningRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.AnalyzeIamPolicyLongrunningRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for analyze_iam_policy_longrunning @@ -285,12 +304,31 @@ def pre_analyze_iam_policy_longrunning(self, request: asset_service.AnalyzeIamPo def post_analyze_iam_policy_longrunning(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for analyze_iam_policy_longrunning - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_analyze_iam_policy_longrunning_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_analyze_iam_policy_longrunning` interceptor runs + before the `post_analyze_iam_policy_longrunning_with_metadata` interceptor. """ return response + def post_analyze_iam_policy_longrunning_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for analyze_iam_policy_longrunning + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_analyze_iam_policy_longrunning_with_metadata` + interceptor in new development instead of the `post_analyze_iam_policy_longrunning` interceptor. + When both interceptors are used, this `post_analyze_iam_policy_longrunning_with_metadata` interceptor runs after the + `post_analyze_iam_policy_longrunning` interceptor. The (possibly modified) response returned by + `post_analyze_iam_policy_longrunning` will be passed to + `post_analyze_iam_policy_longrunning_with_metadata`. + """ + return response, metadata + def pre_analyze_move(self, request: asset_service.AnalyzeMoveRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.AnalyzeMoveRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for analyze_move @@ -302,12 +340,31 @@ def pre_analyze_move(self, request: asset_service.AnalyzeMoveRequest, metadata: def post_analyze_move(self, response: asset_service.AnalyzeMoveResponse) -> asset_service.AnalyzeMoveResponse: """Post-rpc interceptor for analyze_move - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_analyze_move_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_analyze_move` interceptor runs + before the `post_analyze_move_with_metadata` interceptor. """ return response + def post_analyze_move_with_metadata(self, response: asset_service.AnalyzeMoveResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.AnalyzeMoveResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for analyze_move + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_analyze_move_with_metadata` + interceptor in new development instead of the `post_analyze_move` interceptor. + When both interceptors are used, this `post_analyze_move_with_metadata` interceptor runs after the + `post_analyze_move` interceptor. The (possibly modified) response returned by + `post_analyze_move` will be passed to + `post_analyze_move_with_metadata`. + """ + return response, metadata + def pre_analyze_org_policies(self, request: asset_service.AnalyzeOrgPoliciesRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.AnalyzeOrgPoliciesRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for analyze_org_policies @@ -319,12 +376,31 @@ def pre_analyze_org_policies(self, request: asset_service.AnalyzeOrgPoliciesRequ def post_analyze_org_policies(self, response: asset_service.AnalyzeOrgPoliciesResponse) -> asset_service.AnalyzeOrgPoliciesResponse: """Post-rpc interceptor for analyze_org_policies - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_analyze_org_policies_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_analyze_org_policies` interceptor runs + before the `post_analyze_org_policies_with_metadata` interceptor. """ return response + def post_analyze_org_policies_with_metadata(self, response: asset_service.AnalyzeOrgPoliciesResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.AnalyzeOrgPoliciesResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for analyze_org_policies + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_analyze_org_policies_with_metadata` + interceptor in new development instead of the `post_analyze_org_policies` interceptor. + When both interceptors are used, this `post_analyze_org_policies_with_metadata` interceptor runs after the + `post_analyze_org_policies` interceptor. The (possibly modified) response returned by + `post_analyze_org_policies` will be passed to + `post_analyze_org_policies_with_metadata`. + """ + return response, metadata + def pre_analyze_org_policy_governed_assets(self, request: asset_service.AnalyzeOrgPolicyGovernedAssetsRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.AnalyzeOrgPolicyGovernedAssetsRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for analyze_org_policy_governed_assets @@ -336,12 +412,31 @@ def pre_analyze_org_policy_governed_assets(self, request: asset_service.AnalyzeO def post_analyze_org_policy_governed_assets(self, response: asset_service.AnalyzeOrgPolicyGovernedAssetsResponse) -> asset_service.AnalyzeOrgPolicyGovernedAssetsResponse: """Post-rpc interceptor for analyze_org_policy_governed_assets - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_analyze_org_policy_governed_assets_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_analyze_org_policy_governed_assets` interceptor runs + before the `post_analyze_org_policy_governed_assets_with_metadata` interceptor. """ return response + def post_analyze_org_policy_governed_assets_with_metadata(self, response: asset_service.AnalyzeOrgPolicyGovernedAssetsResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.AnalyzeOrgPolicyGovernedAssetsResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for analyze_org_policy_governed_assets + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_analyze_org_policy_governed_assets_with_metadata` + interceptor in new development instead of the `post_analyze_org_policy_governed_assets` interceptor. + When both interceptors are used, this `post_analyze_org_policy_governed_assets_with_metadata` interceptor runs after the + `post_analyze_org_policy_governed_assets` interceptor. The (possibly modified) response returned by + `post_analyze_org_policy_governed_assets` will be passed to + `post_analyze_org_policy_governed_assets_with_metadata`. + """ + return response, metadata + def pre_analyze_org_policy_governed_containers(self, request: asset_service.AnalyzeOrgPolicyGovernedContainersRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.AnalyzeOrgPolicyGovernedContainersRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for analyze_org_policy_governed_containers @@ -353,12 +448,31 @@ def pre_analyze_org_policy_governed_containers(self, request: asset_service.Anal def post_analyze_org_policy_governed_containers(self, response: asset_service.AnalyzeOrgPolicyGovernedContainersResponse) -> asset_service.AnalyzeOrgPolicyGovernedContainersResponse: """Post-rpc interceptor for analyze_org_policy_governed_containers - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_analyze_org_policy_governed_containers_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_analyze_org_policy_governed_containers` interceptor runs + before the `post_analyze_org_policy_governed_containers_with_metadata` interceptor. """ return response + def post_analyze_org_policy_governed_containers_with_metadata(self, response: asset_service.AnalyzeOrgPolicyGovernedContainersResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.AnalyzeOrgPolicyGovernedContainersResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for analyze_org_policy_governed_containers + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_analyze_org_policy_governed_containers_with_metadata` + interceptor in new development instead of the `post_analyze_org_policy_governed_containers` interceptor. + When both interceptors are used, this `post_analyze_org_policy_governed_containers_with_metadata` interceptor runs after the + `post_analyze_org_policy_governed_containers` interceptor. The (possibly modified) response returned by + `post_analyze_org_policy_governed_containers` will be passed to + `post_analyze_org_policy_governed_containers_with_metadata`. + """ + return response, metadata + def pre_batch_get_assets_history(self, request: asset_service.BatchGetAssetsHistoryRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.BatchGetAssetsHistoryRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for batch_get_assets_history @@ -370,12 +484,31 @@ def pre_batch_get_assets_history(self, request: asset_service.BatchGetAssetsHist def post_batch_get_assets_history(self, response: asset_service.BatchGetAssetsHistoryResponse) -> asset_service.BatchGetAssetsHistoryResponse: """Post-rpc interceptor for batch_get_assets_history - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_batch_get_assets_history_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_batch_get_assets_history` interceptor runs + before the `post_batch_get_assets_history_with_metadata` interceptor. """ return response + def post_batch_get_assets_history_with_metadata(self, response: asset_service.BatchGetAssetsHistoryResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.BatchGetAssetsHistoryResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for batch_get_assets_history + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_batch_get_assets_history_with_metadata` + interceptor in new development instead of the `post_batch_get_assets_history` interceptor. + When both interceptors are used, this `post_batch_get_assets_history_with_metadata` interceptor runs after the + `post_batch_get_assets_history` interceptor. The (possibly modified) response returned by + `post_batch_get_assets_history` will be passed to + `post_batch_get_assets_history_with_metadata`. + """ + return response, metadata + def pre_batch_get_effective_iam_policies(self, request: asset_service.BatchGetEffectiveIamPoliciesRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.BatchGetEffectiveIamPoliciesRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for batch_get_effective_iam_policies @@ -387,12 +520,31 @@ def pre_batch_get_effective_iam_policies(self, request: asset_service.BatchGetEf def post_batch_get_effective_iam_policies(self, response: asset_service.BatchGetEffectiveIamPoliciesResponse) -> asset_service.BatchGetEffectiveIamPoliciesResponse: """Post-rpc interceptor for batch_get_effective_iam_policies - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_batch_get_effective_iam_policies_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_batch_get_effective_iam_policies` interceptor runs + before the `post_batch_get_effective_iam_policies_with_metadata` interceptor. """ return response + def post_batch_get_effective_iam_policies_with_metadata(self, response: asset_service.BatchGetEffectiveIamPoliciesResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.BatchGetEffectiveIamPoliciesResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for batch_get_effective_iam_policies + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_batch_get_effective_iam_policies_with_metadata` + interceptor in new development instead of the `post_batch_get_effective_iam_policies` interceptor. + When both interceptors are used, this `post_batch_get_effective_iam_policies_with_metadata` interceptor runs after the + `post_batch_get_effective_iam_policies` interceptor. The (possibly modified) response returned by + `post_batch_get_effective_iam_policies` will be passed to + `post_batch_get_effective_iam_policies_with_metadata`. + """ + return response, metadata + def pre_create_feed(self, request: asset_service.CreateFeedRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.CreateFeedRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for create_feed @@ -404,12 +556,31 @@ def pre_create_feed(self, request: asset_service.CreateFeedRequest, metadata: Se def post_create_feed(self, response: asset_service.Feed) -> asset_service.Feed: """Post-rpc interceptor for create_feed - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_create_feed_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_create_feed` interceptor runs + before the `post_create_feed_with_metadata` interceptor. """ return response + def post_create_feed_with_metadata(self, response: asset_service.Feed, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.Feed, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for create_feed + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_create_feed_with_metadata` + interceptor in new development instead of the `post_create_feed` interceptor. + When both interceptors are used, this `post_create_feed_with_metadata` interceptor runs after the + `post_create_feed` interceptor. The (possibly modified) response returned by + `post_create_feed` will be passed to + `post_create_feed_with_metadata`. + """ + return response, metadata + def pre_create_saved_query(self, request: asset_service.CreateSavedQueryRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.CreateSavedQueryRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for create_saved_query @@ -421,12 +592,31 @@ def pre_create_saved_query(self, request: asset_service.CreateSavedQueryRequest, def post_create_saved_query(self, response: asset_service.SavedQuery) -> asset_service.SavedQuery: """Post-rpc interceptor for create_saved_query - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_create_saved_query_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_create_saved_query` interceptor runs + before the `post_create_saved_query_with_metadata` interceptor. """ return response + def post_create_saved_query_with_metadata(self, response: asset_service.SavedQuery, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.SavedQuery, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for create_saved_query + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_create_saved_query_with_metadata` + interceptor in new development instead of the `post_create_saved_query` interceptor. + When both interceptors are used, this `post_create_saved_query_with_metadata` interceptor runs after the + `post_create_saved_query` interceptor. The (possibly modified) response returned by + `post_create_saved_query` will be passed to + `post_create_saved_query_with_metadata`. + """ + return response, metadata + def pre_delete_feed(self, request: asset_service.DeleteFeedRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.DeleteFeedRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for delete_feed @@ -454,12 +644,31 @@ def pre_export_assets(self, request: asset_service.ExportAssetsRequest, metadata def post_export_assets(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for export_assets - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_export_assets_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_export_assets` interceptor runs + before the `post_export_assets_with_metadata` interceptor. """ return response + def post_export_assets_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for export_assets + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_export_assets_with_metadata` + interceptor in new development instead of the `post_export_assets` interceptor. + When both interceptors are used, this `post_export_assets_with_metadata` interceptor runs after the + `post_export_assets` interceptor. The (possibly modified) response returned by + `post_export_assets` will be passed to + `post_export_assets_with_metadata`. + """ + return response, metadata + def pre_get_feed(self, request: asset_service.GetFeedRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.GetFeedRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for get_feed @@ -471,12 +680,31 @@ def pre_get_feed(self, request: asset_service.GetFeedRequest, metadata: Sequence def post_get_feed(self, response: asset_service.Feed) -> asset_service.Feed: """Post-rpc interceptor for get_feed - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_get_feed_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_get_feed` interceptor runs + before the `post_get_feed_with_metadata` interceptor. """ return response + def post_get_feed_with_metadata(self, response: asset_service.Feed, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.Feed, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get_feed + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_get_feed_with_metadata` + interceptor in new development instead of the `post_get_feed` interceptor. + When both interceptors are used, this `post_get_feed_with_metadata` interceptor runs after the + `post_get_feed` interceptor. The (possibly modified) response returned by + `post_get_feed` will be passed to + `post_get_feed_with_metadata`. + """ + return response, metadata + def pre_get_saved_query(self, request: asset_service.GetSavedQueryRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.GetSavedQueryRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for get_saved_query @@ -488,12 +716,31 @@ def pre_get_saved_query(self, request: asset_service.GetSavedQueryRequest, metad def post_get_saved_query(self, response: asset_service.SavedQuery) -> asset_service.SavedQuery: """Post-rpc interceptor for get_saved_query - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_get_saved_query_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_get_saved_query` interceptor runs + before the `post_get_saved_query_with_metadata` interceptor. """ return response + def post_get_saved_query_with_metadata(self, response: asset_service.SavedQuery, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.SavedQuery, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get_saved_query + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_get_saved_query_with_metadata` + interceptor in new development instead of the `post_get_saved_query` interceptor. + When both interceptors are used, this `post_get_saved_query_with_metadata` interceptor runs after the + `post_get_saved_query` interceptor. The (possibly modified) response returned by + `post_get_saved_query` will be passed to + `post_get_saved_query_with_metadata`. + """ + return response, metadata + def pre_list_assets(self, request: asset_service.ListAssetsRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.ListAssetsRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for list_assets @@ -505,12 +752,31 @@ def pre_list_assets(self, request: asset_service.ListAssetsRequest, metadata: Se def post_list_assets(self, response: asset_service.ListAssetsResponse) -> asset_service.ListAssetsResponse: """Post-rpc interceptor for list_assets - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_list_assets_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_list_assets` interceptor runs + before the `post_list_assets_with_metadata` interceptor. """ return response + def post_list_assets_with_metadata(self, response: asset_service.ListAssetsResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.ListAssetsResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for list_assets + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_list_assets_with_metadata` + interceptor in new development instead of the `post_list_assets` interceptor. + When both interceptors are used, this `post_list_assets_with_metadata` interceptor runs after the + `post_list_assets` interceptor. The (possibly modified) response returned by + `post_list_assets` will be passed to + `post_list_assets_with_metadata`. + """ + return response, metadata + def pre_list_feeds(self, request: asset_service.ListFeedsRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.ListFeedsRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for list_feeds @@ -522,12 +788,31 @@ def pre_list_feeds(self, request: asset_service.ListFeedsRequest, metadata: Sequ def post_list_feeds(self, response: asset_service.ListFeedsResponse) -> asset_service.ListFeedsResponse: """Post-rpc interceptor for list_feeds - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_list_feeds_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_list_feeds` interceptor runs + before the `post_list_feeds_with_metadata` interceptor. """ return response + def post_list_feeds_with_metadata(self, response: asset_service.ListFeedsResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.ListFeedsResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for list_feeds + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_list_feeds_with_metadata` + interceptor in new development instead of the `post_list_feeds` interceptor. + When both interceptors are used, this `post_list_feeds_with_metadata` interceptor runs after the + `post_list_feeds` interceptor. The (possibly modified) response returned by + `post_list_feeds` will be passed to + `post_list_feeds_with_metadata`. + """ + return response, metadata + def pre_list_saved_queries(self, request: asset_service.ListSavedQueriesRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.ListSavedQueriesRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for list_saved_queries @@ -539,12 +824,31 @@ def pre_list_saved_queries(self, request: asset_service.ListSavedQueriesRequest, def post_list_saved_queries(self, response: asset_service.ListSavedQueriesResponse) -> asset_service.ListSavedQueriesResponse: """Post-rpc interceptor for list_saved_queries - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_list_saved_queries_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_list_saved_queries` interceptor runs + before the `post_list_saved_queries_with_metadata` interceptor. """ return response + def post_list_saved_queries_with_metadata(self, response: asset_service.ListSavedQueriesResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.ListSavedQueriesResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for list_saved_queries + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_list_saved_queries_with_metadata` + interceptor in new development instead of the `post_list_saved_queries` interceptor. + When both interceptors are used, this `post_list_saved_queries_with_metadata` interceptor runs after the + `post_list_saved_queries` interceptor. The (possibly modified) response returned by + `post_list_saved_queries` will be passed to + `post_list_saved_queries_with_metadata`. + """ + return response, metadata + def pre_query_assets(self, request: asset_service.QueryAssetsRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.QueryAssetsRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for query_assets @@ -556,12 +860,31 @@ def pre_query_assets(self, request: asset_service.QueryAssetsRequest, metadata: def post_query_assets(self, response: asset_service.QueryAssetsResponse) -> asset_service.QueryAssetsResponse: """Post-rpc interceptor for query_assets - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_query_assets_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_query_assets` interceptor runs + before the `post_query_assets_with_metadata` interceptor. """ return response + def post_query_assets_with_metadata(self, response: asset_service.QueryAssetsResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.QueryAssetsResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for query_assets + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_query_assets_with_metadata` + interceptor in new development instead of the `post_query_assets` interceptor. + When both interceptors are used, this `post_query_assets_with_metadata` interceptor runs after the + `post_query_assets` interceptor. The (possibly modified) response returned by + `post_query_assets` will be passed to + `post_query_assets_with_metadata`. + """ + return response, metadata + def pre_search_all_iam_policies(self, request: asset_service.SearchAllIamPoliciesRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.SearchAllIamPoliciesRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for search_all_iam_policies @@ -573,12 +896,31 @@ def pre_search_all_iam_policies(self, request: asset_service.SearchAllIamPolicie def post_search_all_iam_policies(self, response: asset_service.SearchAllIamPoliciesResponse) -> asset_service.SearchAllIamPoliciesResponse: """Post-rpc interceptor for search_all_iam_policies - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_search_all_iam_policies_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_search_all_iam_policies` interceptor runs + before the `post_search_all_iam_policies_with_metadata` interceptor. """ return response + def post_search_all_iam_policies_with_metadata(self, response: asset_service.SearchAllIamPoliciesResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.SearchAllIamPoliciesResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for search_all_iam_policies + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_search_all_iam_policies_with_metadata` + interceptor in new development instead of the `post_search_all_iam_policies` interceptor. + When both interceptors are used, this `post_search_all_iam_policies_with_metadata` interceptor runs after the + `post_search_all_iam_policies` interceptor. The (possibly modified) response returned by + `post_search_all_iam_policies` will be passed to + `post_search_all_iam_policies_with_metadata`. + """ + return response, metadata + def pre_search_all_resources(self, request: asset_service.SearchAllResourcesRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.SearchAllResourcesRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for search_all_resources @@ -590,12 +932,31 @@ def pre_search_all_resources(self, request: asset_service.SearchAllResourcesRequ def post_search_all_resources(self, response: asset_service.SearchAllResourcesResponse) -> asset_service.SearchAllResourcesResponse: """Post-rpc interceptor for search_all_resources - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_search_all_resources_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_search_all_resources` interceptor runs + before the `post_search_all_resources_with_metadata` interceptor. """ return response + def post_search_all_resources_with_metadata(self, response: asset_service.SearchAllResourcesResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.SearchAllResourcesResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for search_all_resources + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_search_all_resources_with_metadata` + interceptor in new development instead of the `post_search_all_resources` interceptor. + When both interceptors are used, this `post_search_all_resources_with_metadata` interceptor runs after the + `post_search_all_resources` interceptor. The (possibly modified) response returned by + `post_search_all_resources` will be passed to + `post_search_all_resources_with_metadata`. + """ + return response, metadata + def pre_update_feed(self, request: asset_service.UpdateFeedRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.UpdateFeedRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for update_feed @@ -607,12 +968,31 @@ def pre_update_feed(self, request: asset_service.UpdateFeedRequest, metadata: Se def post_update_feed(self, response: asset_service.Feed) -> asset_service.Feed: """Post-rpc interceptor for update_feed - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_update_feed_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_update_feed` interceptor runs + before the `post_update_feed_with_metadata` interceptor. """ return response + def post_update_feed_with_metadata(self, response: asset_service.Feed, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.Feed, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for update_feed + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_update_feed_with_metadata` + interceptor in new development instead of the `post_update_feed` interceptor. + When both interceptors are used, this `post_update_feed_with_metadata` interceptor runs after the + `post_update_feed` interceptor. The (possibly modified) response returned by + `post_update_feed` will be passed to + `post_update_feed_with_metadata`. + """ + return response, metadata + def pre_update_saved_query(self, request: asset_service.UpdateSavedQueryRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.UpdateSavedQueryRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for update_saved_query @@ -624,12 +1004,31 @@ def pre_update_saved_query(self, request: asset_service.UpdateSavedQueryRequest, def post_update_saved_query(self, response: asset_service.SavedQuery) -> asset_service.SavedQuery: """Post-rpc interceptor for update_saved_query - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_update_saved_query_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the AssetService server but before - it is returned to user code. + it is returned to user code. This `post_update_saved_query` interceptor runs + before the `post_update_saved_query_with_metadata` interceptor. """ return response + def post_update_saved_query_with_metadata(self, response: asset_service.SavedQuery, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[asset_service.SavedQuery, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for update_saved_query + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the AssetService server but before it is returned to user code. + + We recommend only using this `post_update_saved_query_with_metadata` + interceptor in new development instead of the `post_update_saved_query` interceptor. + When both interceptors are used, this `post_update_saved_query_with_metadata` interceptor runs after the + `post_update_saved_query` interceptor. The (possibly modified) response returned by + `post_update_saved_query` will be passed to + `post_update_saved_query_with_metadata`. + """ + return response, metadata + def pre_get_operation( self, request: operations_pb2.GetOperationRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]] ) -> Tuple[operations_pb2.GetOperationRequest, Sequence[Tuple[str, Union[str, bytes]]]]: @@ -871,6 +1270,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_analyze_iam_policy(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_analyze_iam_policy_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.AnalyzeIamPolicyResponse.to_json(response) @@ -994,6 +1395,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_analyze_iam_policy_longrunning(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_analyze_iam_policy_longrunning_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -1114,6 +1517,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_analyze_move(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_analyze_move_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.AnalyzeMoveResponse.to_json(response) @@ -1234,6 +1639,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_analyze_org_policies(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_analyze_org_policies_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.AnalyzeOrgPoliciesResponse.to_json(response) @@ -1355,6 +1762,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_analyze_org_policy_governed_assets(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_analyze_org_policy_governed_assets_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse.to_json(response) @@ -1476,6 +1885,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_analyze_org_policy_governed_containers(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_analyze_org_policy_governed_containers_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.AnalyzeOrgPolicyGovernedContainersResponse.to_json(response) @@ -1593,6 +2004,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_batch_get_assets_history(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_batch_get_assets_history_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.BatchGetAssetsHistoryResponse.to_json(response) @@ -1714,6 +2127,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_batch_get_effective_iam_policies(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_batch_get_effective_iam_policies_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.BatchGetEffectiveIamPoliciesResponse.to_json(response) @@ -1842,6 +2257,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_create_feed(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_create_feed_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.Feed.to_json(response) @@ -1964,6 +2381,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_create_saved_query(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_create_saved_query_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.SavedQuery.to_json(response) @@ -2255,6 +2674,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_export_assets(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_export_assets_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -2380,6 +2801,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_get_feed(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_feed_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.Feed.to_json(response) @@ -2499,6 +2922,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_get_saved_query(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_saved_query_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.SavedQuery.to_json(response) @@ -2616,6 +3041,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_list_assets(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_assets_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.ListAssetsResponse.to_json(response) @@ -2733,6 +3160,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_list_feeds(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_feeds_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.ListFeedsResponse.to_json(response) @@ -2850,6 +3279,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_list_saved_queries(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_saved_queries_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.ListSavedQueriesResponse.to_json(response) @@ -2970,6 +3401,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_query_assets(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_query_assets_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.QueryAssetsResponse.to_json(response) @@ -3087,6 +3520,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_search_all_iam_policies(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_search_all_iam_policies_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.SearchAllIamPoliciesResponse.to_json(response) @@ -3204,6 +3639,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_search_all_resources(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_search_all_resources_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.SearchAllResourcesResponse.to_json(response) @@ -3332,6 +3769,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_update_feed(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_update_feed_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.Feed.to_json(response) @@ -3454,6 +3893,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_update_saved_query(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_update_saved_query_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = asset_service.SavedQuery.to_json(response) diff --git a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py index 61e40a62e..b27b49cd3 100755 --- a/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/tests/integration/goldens/asset/tests/unit/gapic/asset_v1/test_asset_service.py @@ -14196,9 +14196,11 @@ def test_export_assets_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_export_assets") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_export_assets_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_export_assets") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.ExportAssetsRequest.pb(asset_service.ExportAssetsRequest()) transcode.return_value = { "method": "post", @@ -14220,11 +14222,13 @@ def test_export_assets_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.export_assets(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_list_assets_rest_bad_request(request_type=asset_service.ListAssetsRequest): @@ -14298,9 +14302,11 @@ def test_list_assets_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_list_assets") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_list_assets_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_list_assets") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.ListAssetsRequest.pb(asset_service.ListAssetsRequest()) transcode.return_value = { "method": "post", @@ -14322,11 +14328,13 @@ def test_list_assets_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.ListAssetsResponse() + post_with_metadata.return_value = asset_service.ListAssetsResponse(), metadata client.list_assets(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_batch_get_assets_history_rest_bad_request(request_type=asset_service.BatchGetAssetsHistoryRequest): @@ -14398,9 +14406,11 @@ def test_batch_get_assets_history_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_batch_get_assets_history") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_batch_get_assets_history_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_batch_get_assets_history") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.BatchGetAssetsHistoryRequest.pb(asset_service.BatchGetAssetsHistoryRequest()) transcode.return_value = { "method": "post", @@ -14422,11 +14432,13 @@ def test_batch_get_assets_history_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.BatchGetAssetsHistoryResponse() + post_with_metadata.return_value = asset_service.BatchGetAssetsHistoryResponse(), metadata client.batch_get_assets_history(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_create_feed_rest_bad_request(request_type=asset_service.CreateFeedRequest): @@ -14508,9 +14520,11 @@ def test_create_feed_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_create_feed") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_create_feed_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_create_feed") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.CreateFeedRequest.pb(asset_service.CreateFeedRequest()) transcode.return_value = { "method": "post", @@ -14532,11 +14546,13 @@ def test_create_feed_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.Feed() + post_with_metadata.return_value = asset_service.Feed(), metadata client.create_feed(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_get_feed_rest_bad_request(request_type=asset_service.GetFeedRequest): @@ -14618,9 +14634,11 @@ def test_get_feed_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_get_feed") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_get_feed_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_get_feed") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.GetFeedRequest.pb(asset_service.GetFeedRequest()) transcode.return_value = { "method": "post", @@ -14642,11 +14660,13 @@ def test_get_feed_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.Feed() + post_with_metadata.return_value = asset_service.Feed(), metadata client.get_feed(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_list_feeds_rest_bad_request(request_type=asset_service.ListFeedsRequest): @@ -14718,9 +14738,11 @@ def test_list_feeds_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_list_feeds") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_list_feeds_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_list_feeds") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.ListFeedsRequest.pb(asset_service.ListFeedsRequest()) transcode.return_value = { "method": "post", @@ -14742,11 +14764,13 @@ def test_list_feeds_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.ListFeedsResponse() + post_with_metadata.return_value = asset_service.ListFeedsResponse(), metadata client.list_feeds(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_update_feed_rest_bad_request(request_type=asset_service.UpdateFeedRequest): @@ -14828,9 +14852,11 @@ def test_update_feed_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_update_feed") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_update_feed_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_update_feed") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.UpdateFeedRequest.pb(asset_service.UpdateFeedRequest()) transcode.return_value = { "method": "post", @@ -14852,11 +14878,13 @@ def test_update_feed_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.Feed() + post_with_metadata.return_value = asset_service.Feed(), metadata client.update_feed(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_delete_feed_rest_bad_request(request_type=asset_service.DeleteFeedRequest): @@ -15020,9 +15048,11 @@ def test_search_all_resources_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_search_all_resources") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_search_all_resources_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_search_all_resources") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.SearchAllResourcesRequest.pb(asset_service.SearchAllResourcesRequest()) transcode.return_value = { "method": "post", @@ -15044,11 +15074,13 @@ def test_search_all_resources_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.SearchAllResourcesResponse() + post_with_metadata.return_value = asset_service.SearchAllResourcesResponse(), metadata client.search_all_resources(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_search_all_iam_policies_rest_bad_request(request_type=asset_service.SearchAllIamPoliciesRequest): @@ -15122,9 +15154,11 @@ def test_search_all_iam_policies_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_search_all_iam_policies") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_search_all_iam_policies_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_search_all_iam_policies") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.SearchAllIamPoliciesRequest.pb(asset_service.SearchAllIamPoliciesRequest()) transcode.return_value = { "method": "post", @@ -15146,11 +15180,13 @@ def test_search_all_iam_policies_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.SearchAllIamPoliciesResponse() + post_with_metadata.return_value = asset_service.SearchAllIamPoliciesResponse(), metadata client.search_all_iam_policies(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_analyze_iam_policy_rest_bad_request(request_type=asset_service.AnalyzeIamPolicyRequest): @@ -15224,9 +15260,11 @@ def test_analyze_iam_policy_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_iam_policy") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_iam_policy_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_analyze_iam_policy") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.AnalyzeIamPolicyRequest.pb(asset_service.AnalyzeIamPolicyRequest()) transcode.return_value = { "method": "post", @@ -15248,11 +15286,13 @@ def test_analyze_iam_policy_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.AnalyzeIamPolicyResponse() + post_with_metadata.return_value = asset_service.AnalyzeIamPolicyResponse(), metadata client.analyze_iam_policy(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_analyze_iam_policy_longrunning_rest_bad_request(request_type=asset_service.AnalyzeIamPolicyLongrunningRequest): @@ -15321,9 +15361,11 @@ def test_analyze_iam_policy_longrunning_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_iam_policy_longrunning") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_iam_policy_longrunning_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_analyze_iam_policy_longrunning") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.AnalyzeIamPolicyLongrunningRequest.pb(asset_service.AnalyzeIamPolicyLongrunningRequest()) transcode.return_value = { "method": "post", @@ -15345,11 +15387,13 @@ def test_analyze_iam_policy_longrunning_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.analyze_iam_policy_longrunning(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_analyze_move_rest_bad_request(request_type=asset_service.AnalyzeMoveRequest): @@ -15421,9 +15465,11 @@ def test_analyze_move_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_move") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_move_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_analyze_move") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.AnalyzeMoveRequest.pb(asset_service.AnalyzeMoveRequest()) transcode.return_value = { "method": "post", @@ -15445,11 +15491,13 @@ def test_analyze_move_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.AnalyzeMoveResponse() + post_with_metadata.return_value = asset_service.AnalyzeMoveResponse(), metadata client.analyze_move(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_query_assets_rest_bad_request(request_type=asset_service.QueryAssetsRequest): @@ -15525,9 +15573,11 @@ def test_query_assets_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_query_assets") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_query_assets_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_query_assets") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.QueryAssetsRequest.pb(asset_service.QueryAssetsRequest()) transcode.return_value = { "method": "post", @@ -15549,11 +15599,13 @@ def test_query_assets_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.QueryAssetsResponse() + post_with_metadata.return_value = asset_service.QueryAssetsResponse(), metadata client.query_assets(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_create_saved_query_rest_bad_request(request_type=asset_service.CreateSavedQueryRequest): @@ -15697,9 +15749,11 @@ def test_create_saved_query_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_create_saved_query") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_create_saved_query_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_create_saved_query") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.CreateSavedQueryRequest.pb(asset_service.CreateSavedQueryRequest()) transcode.return_value = { "method": "post", @@ -15721,11 +15775,13 @@ def test_create_saved_query_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.SavedQuery() + post_with_metadata.return_value = asset_service.SavedQuery(), metadata client.create_saved_query(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_get_saved_query_rest_bad_request(request_type=asset_service.GetSavedQueryRequest): @@ -15805,9 +15861,11 @@ def test_get_saved_query_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_get_saved_query") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_get_saved_query_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_get_saved_query") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.GetSavedQueryRequest.pb(asset_service.GetSavedQueryRequest()) transcode.return_value = { "method": "post", @@ -15829,11 +15887,13 @@ def test_get_saved_query_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.SavedQuery() + post_with_metadata.return_value = asset_service.SavedQuery(), metadata client.get_saved_query(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_list_saved_queries_rest_bad_request(request_type=asset_service.ListSavedQueriesRequest): @@ -15907,9 +15967,11 @@ def test_list_saved_queries_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_list_saved_queries") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_list_saved_queries_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_list_saved_queries") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.ListSavedQueriesRequest.pb(asset_service.ListSavedQueriesRequest()) transcode.return_value = { "method": "post", @@ -15931,11 +15993,13 @@ def test_list_saved_queries_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.ListSavedQueriesResponse() + post_with_metadata.return_value = asset_service.ListSavedQueriesResponse(), metadata client.list_saved_queries(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_update_saved_query_rest_bad_request(request_type=asset_service.UpdateSavedQueryRequest): @@ -16079,9 +16143,11 @@ def test_update_saved_query_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_update_saved_query") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_update_saved_query_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_update_saved_query") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.UpdateSavedQueryRequest.pb(asset_service.UpdateSavedQueryRequest()) transcode.return_value = { "method": "post", @@ -16103,11 +16169,13 @@ def test_update_saved_query_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.SavedQuery() + post_with_metadata.return_value = asset_service.SavedQuery(), metadata client.update_saved_query(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_delete_saved_query_rest_bad_request(request_type=asset_service.DeleteSavedQueryRequest): @@ -16269,9 +16337,11 @@ def test_batch_get_effective_iam_policies_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_batch_get_effective_iam_policies") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_batch_get_effective_iam_policies_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_batch_get_effective_iam_policies") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.BatchGetEffectiveIamPoliciesRequest.pb(asset_service.BatchGetEffectiveIamPoliciesRequest()) transcode.return_value = { "method": "post", @@ -16293,11 +16363,13 @@ def test_batch_get_effective_iam_policies_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.BatchGetEffectiveIamPoliciesResponse() + post_with_metadata.return_value = asset_service.BatchGetEffectiveIamPoliciesResponse(), metadata client.batch_get_effective_iam_policies(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_analyze_org_policies_rest_bad_request(request_type=asset_service.AnalyzeOrgPoliciesRequest): @@ -16371,9 +16443,11 @@ def test_analyze_org_policies_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_org_policies") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_org_policies_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_analyze_org_policies") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.AnalyzeOrgPoliciesRequest.pb(asset_service.AnalyzeOrgPoliciesRequest()) transcode.return_value = { "method": "post", @@ -16395,11 +16469,13 @@ def test_analyze_org_policies_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.AnalyzeOrgPoliciesResponse() + post_with_metadata.return_value = asset_service.AnalyzeOrgPoliciesResponse(), metadata client.analyze_org_policies(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_analyze_org_policy_governed_containers_rest_bad_request(request_type=asset_service.AnalyzeOrgPolicyGovernedContainersRequest): @@ -16473,9 +16549,11 @@ def test_analyze_org_policy_governed_containers_rest_interceptors(null_intercept with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_org_policy_governed_containers") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_org_policy_governed_containers_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_analyze_org_policy_governed_containers") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.AnalyzeOrgPolicyGovernedContainersRequest.pb(asset_service.AnalyzeOrgPolicyGovernedContainersRequest()) transcode.return_value = { "method": "post", @@ -16497,11 +16575,13 @@ def test_analyze_org_policy_governed_containers_rest_interceptors(null_intercept ] pre.return_value = request, metadata post.return_value = asset_service.AnalyzeOrgPolicyGovernedContainersResponse() + post_with_metadata.return_value = asset_service.AnalyzeOrgPolicyGovernedContainersResponse(), metadata client.analyze_org_policy_governed_containers(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_analyze_org_policy_governed_assets_rest_bad_request(request_type=asset_service.AnalyzeOrgPolicyGovernedAssetsRequest): @@ -16575,9 +16655,11 @@ def test_analyze_org_policy_governed_assets_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_org_policy_governed_assets") as post, \ + mock.patch.object(transports.AssetServiceRestInterceptor, "post_analyze_org_policy_governed_assets_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AssetServiceRestInterceptor, "pre_analyze_org_policy_governed_assets") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = asset_service.AnalyzeOrgPolicyGovernedAssetsRequest.pb(asset_service.AnalyzeOrgPolicyGovernedAssetsRequest()) transcode.return_value = { "method": "post", @@ -16599,11 +16681,13 @@ def test_analyze_org_policy_governed_assets_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse() + post_with_metadata.return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse(), metadata client.analyze_org_policy_governed_assets(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_get_operation_rest_bad_request(request_type=operations_pb2.GetOperationRequest): diff --git a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/transports/rest.py b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/transports/rest.py index 9cf97b875..9dc7959ac 100755 --- a/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/transports/rest.py +++ b/tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/transports/rest.py @@ -121,12 +121,31 @@ def pre_generate_access_token(self, request: common.GenerateAccessTokenRequest, def post_generate_access_token(self, response: common.GenerateAccessTokenResponse) -> common.GenerateAccessTokenResponse: """Post-rpc interceptor for generate_access_token - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_generate_access_token_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the IAMCredentials server but before - it is returned to user code. + it is returned to user code. This `post_generate_access_token` interceptor runs + before the `post_generate_access_token_with_metadata` interceptor. """ return response + def post_generate_access_token_with_metadata(self, response: common.GenerateAccessTokenResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[common.GenerateAccessTokenResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for generate_access_token + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the IAMCredentials server but before it is returned to user code. + + We recommend only using this `post_generate_access_token_with_metadata` + interceptor in new development instead of the `post_generate_access_token` interceptor. + When both interceptors are used, this `post_generate_access_token_with_metadata` interceptor runs after the + `post_generate_access_token` interceptor. The (possibly modified) response returned by + `post_generate_access_token` will be passed to + `post_generate_access_token_with_metadata`. + """ + return response, metadata + def pre_generate_id_token(self, request: common.GenerateIdTokenRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[common.GenerateIdTokenRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for generate_id_token @@ -138,12 +157,31 @@ def pre_generate_id_token(self, request: common.GenerateIdTokenRequest, metadata def post_generate_id_token(self, response: common.GenerateIdTokenResponse) -> common.GenerateIdTokenResponse: """Post-rpc interceptor for generate_id_token - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_generate_id_token_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the IAMCredentials server but before - it is returned to user code. + it is returned to user code. This `post_generate_id_token` interceptor runs + before the `post_generate_id_token_with_metadata` interceptor. """ return response + def post_generate_id_token_with_metadata(self, response: common.GenerateIdTokenResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[common.GenerateIdTokenResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for generate_id_token + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the IAMCredentials server but before it is returned to user code. + + We recommend only using this `post_generate_id_token_with_metadata` + interceptor in new development instead of the `post_generate_id_token` interceptor. + When both interceptors are used, this `post_generate_id_token_with_metadata` interceptor runs after the + `post_generate_id_token` interceptor. The (possibly modified) response returned by + `post_generate_id_token` will be passed to + `post_generate_id_token_with_metadata`. + """ + return response, metadata + def pre_sign_blob(self, request: common.SignBlobRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[common.SignBlobRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for sign_blob @@ -155,12 +193,31 @@ def pre_sign_blob(self, request: common.SignBlobRequest, metadata: Sequence[Tupl def post_sign_blob(self, response: common.SignBlobResponse) -> common.SignBlobResponse: """Post-rpc interceptor for sign_blob - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_sign_blob_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the IAMCredentials server but before - it is returned to user code. + it is returned to user code. This `post_sign_blob` interceptor runs + before the `post_sign_blob_with_metadata` interceptor. """ return response + def post_sign_blob_with_metadata(self, response: common.SignBlobResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[common.SignBlobResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for sign_blob + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the IAMCredentials server but before it is returned to user code. + + We recommend only using this `post_sign_blob_with_metadata` + interceptor in new development instead of the `post_sign_blob` interceptor. + When both interceptors are used, this `post_sign_blob_with_metadata` interceptor runs after the + `post_sign_blob` interceptor. The (possibly modified) response returned by + `post_sign_blob` will be passed to + `post_sign_blob_with_metadata`. + """ + return response, metadata + def pre_sign_jwt(self, request: common.SignJwtRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[common.SignJwtRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for sign_jwt @@ -172,12 +229,31 @@ def pre_sign_jwt(self, request: common.SignJwtRequest, metadata: Sequence[Tuple[ def post_sign_jwt(self, response: common.SignJwtResponse) -> common.SignJwtResponse: """Post-rpc interceptor for sign_jwt - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_sign_jwt_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the IAMCredentials server but before - it is returned to user code. + it is returned to user code. This `post_sign_jwt` interceptor runs + before the `post_sign_jwt_with_metadata` interceptor. """ return response + def post_sign_jwt_with_metadata(self, response: common.SignJwtResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[common.SignJwtResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for sign_jwt + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the IAMCredentials server but before it is returned to user code. + + We recommend only using this `post_sign_jwt_with_metadata` + interceptor in new development instead of the `post_sign_jwt` interceptor. + When both interceptors are used, this `post_sign_jwt_with_metadata` interceptor runs after the + `post_sign_jwt` interceptor. The (possibly modified) response returned by + `post_sign_jwt` will be passed to + `post_sign_jwt_with_metadata`. + """ + return response, metadata + @dataclasses.dataclass class IAMCredentialsRestStub: @@ -375,6 +451,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_generate_access_token(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_generate_access_token_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = common.GenerateAccessTokenResponse.to_json(response) @@ -495,6 +573,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_generate_id_token(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_generate_id_token_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = common.GenerateIdTokenResponse.to_json(response) @@ -615,6 +695,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_sign_blob(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_sign_blob_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = common.SignBlobResponse.to_json(response) @@ -735,6 +817,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_sign_jwt(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_sign_jwt_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = common.SignJwtResponse.to_json(response) diff --git a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py index 715989b7c..d31e01c82 100755 --- a/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py +++ b/tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/test_iam_credentials.py @@ -3162,9 +3162,11 @@ def test_generate_access_token_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.IAMCredentialsRestInterceptor, "post_generate_access_token") as post, \ + mock.patch.object(transports.IAMCredentialsRestInterceptor, "post_generate_access_token_with_metadata") as post_with_metadata, \ mock.patch.object(transports.IAMCredentialsRestInterceptor, "pre_generate_access_token") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = common.GenerateAccessTokenRequest.pb(common.GenerateAccessTokenRequest()) transcode.return_value = { "method": "post", @@ -3186,11 +3188,13 @@ def test_generate_access_token_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = common.GenerateAccessTokenResponse() + post_with_metadata.return_value = common.GenerateAccessTokenResponse(), metadata client.generate_access_token(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_generate_id_token_rest_bad_request(request_type=common.GenerateIdTokenRequest): @@ -3264,9 +3268,11 @@ def test_generate_id_token_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.IAMCredentialsRestInterceptor, "post_generate_id_token") as post, \ + mock.patch.object(transports.IAMCredentialsRestInterceptor, "post_generate_id_token_with_metadata") as post_with_metadata, \ mock.patch.object(transports.IAMCredentialsRestInterceptor, "pre_generate_id_token") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = common.GenerateIdTokenRequest.pb(common.GenerateIdTokenRequest()) transcode.return_value = { "method": "post", @@ -3288,11 +3294,13 @@ def test_generate_id_token_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = common.GenerateIdTokenResponse() + post_with_metadata.return_value = common.GenerateIdTokenResponse(), metadata client.generate_id_token(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_sign_blob_rest_bad_request(request_type=common.SignBlobRequest): @@ -3368,9 +3376,11 @@ def test_sign_blob_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.IAMCredentialsRestInterceptor, "post_sign_blob") as post, \ + mock.patch.object(transports.IAMCredentialsRestInterceptor, "post_sign_blob_with_metadata") as post_with_metadata, \ mock.patch.object(transports.IAMCredentialsRestInterceptor, "pre_sign_blob") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = common.SignBlobRequest.pb(common.SignBlobRequest()) transcode.return_value = { "method": "post", @@ -3392,11 +3402,13 @@ def test_sign_blob_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = common.SignBlobResponse() + post_with_metadata.return_value = common.SignBlobResponse(), metadata client.sign_blob(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_sign_jwt_rest_bad_request(request_type=common.SignJwtRequest): @@ -3472,9 +3484,11 @@ def test_sign_jwt_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.IAMCredentialsRestInterceptor, "post_sign_jwt") as post, \ + mock.patch.object(transports.IAMCredentialsRestInterceptor, "post_sign_jwt_with_metadata") as post_with_metadata, \ mock.patch.object(transports.IAMCredentialsRestInterceptor, "pre_sign_jwt") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = common.SignJwtRequest.pb(common.SignJwtRequest()) transcode.return_value = { "method": "post", @@ -3496,11 +3510,13 @@ def test_sign_jwt_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = common.SignJwtResponse() + post_with_metadata.return_value = common.SignJwtResponse(), metadata client.sign_jwt(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_initialize_client_w_rest(): client = IAMCredentialsClient( diff --git a/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/transports/rest.py b/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/transports/rest.py index 583ee4301..32211ddf9 100755 --- a/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/transports/rest.py +++ b/tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/transports/rest.py @@ -244,12 +244,31 @@ def pre_create_channel(self, request: eventarc.CreateChannelRequest, metadata: S def post_create_channel(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for create_channel - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_create_channel_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_create_channel` interceptor runs + before the `post_create_channel_with_metadata` interceptor. """ return response + def post_create_channel_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for create_channel + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_create_channel_with_metadata` + interceptor in new development instead of the `post_create_channel` interceptor. + When both interceptors are used, this `post_create_channel_with_metadata` interceptor runs after the + `post_create_channel` interceptor. The (possibly modified) response returned by + `post_create_channel` will be passed to + `post_create_channel_with_metadata`. + """ + return response, metadata + def pre_create_channel_connection(self, request: eventarc.CreateChannelConnectionRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.CreateChannelConnectionRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for create_channel_connection @@ -261,12 +280,31 @@ def pre_create_channel_connection(self, request: eventarc.CreateChannelConnectio def post_create_channel_connection(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for create_channel_connection - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_create_channel_connection_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_create_channel_connection` interceptor runs + before the `post_create_channel_connection_with_metadata` interceptor. """ return response + def post_create_channel_connection_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for create_channel_connection + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_create_channel_connection_with_metadata` + interceptor in new development instead of the `post_create_channel_connection` interceptor. + When both interceptors are used, this `post_create_channel_connection_with_metadata` interceptor runs after the + `post_create_channel_connection` interceptor. The (possibly modified) response returned by + `post_create_channel_connection` will be passed to + `post_create_channel_connection_with_metadata`. + """ + return response, metadata + def pre_create_trigger(self, request: eventarc.CreateTriggerRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.CreateTriggerRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for create_trigger @@ -278,12 +316,31 @@ def pre_create_trigger(self, request: eventarc.CreateTriggerRequest, metadata: S def post_create_trigger(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for create_trigger - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_create_trigger_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_create_trigger` interceptor runs + before the `post_create_trigger_with_metadata` interceptor. """ return response + def post_create_trigger_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for create_trigger + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_create_trigger_with_metadata` + interceptor in new development instead of the `post_create_trigger` interceptor. + When both interceptors are used, this `post_create_trigger_with_metadata` interceptor runs after the + `post_create_trigger` interceptor. The (possibly modified) response returned by + `post_create_trigger` will be passed to + `post_create_trigger_with_metadata`. + """ + return response, metadata + def pre_delete_channel(self, request: eventarc.DeleteChannelRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.DeleteChannelRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for delete_channel @@ -295,12 +352,31 @@ def pre_delete_channel(self, request: eventarc.DeleteChannelRequest, metadata: S def post_delete_channel(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for delete_channel - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_delete_channel_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_delete_channel` interceptor runs + before the `post_delete_channel_with_metadata` interceptor. """ return response + def post_delete_channel_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for delete_channel + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_delete_channel_with_metadata` + interceptor in new development instead of the `post_delete_channel` interceptor. + When both interceptors are used, this `post_delete_channel_with_metadata` interceptor runs after the + `post_delete_channel` interceptor. The (possibly modified) response returned by + `post_delete_channel` will be passed to + `post_delete_channel_with_metadata`. + """ + return response, metadata + def pre_delete_channel_connection(self, request: eventarc.DeleteChannelConnectionRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.DeleteChannelConnectionRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for delete_channel_connection @@ -312,12 +388,31 @@ def pre_delete_channel_connection(self, request: eventarc.DeleteChannelConnectio def post_delete_channel_connection(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for delete_channel_connection - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_delete_channel_connection_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_delete_channel_connection` interceptor runs + before the `post_delete_channel_connection_with_metadata` interceptor. """ return response + def post_delete_channel_connection_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for delete_channel_connection + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_delete_channel_connection_with_metadata` + interceptor in new development instead of the `post_delete_channel_connection` interceptor. + When both interceptors are used, this `post_delete_channel_connection_with_metadata` interceptor runs after the + `post_delete_channel_connection` interceptor. The (possibly modified) response returned by + `post_delete_channel_connection` will be passed to + `post_delete_channel_connection_with_metadata`. + """ + return response, metadata + def pre_delete_trigger(self, request: eventarc.DeleteTriggerRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.DeleteTriggerRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for delete_trigger @@ -329,12 +424,31 @@ def pre_delete_trigger(self, request: eventarc.DeleteTriggerRequest, metadata: S def post_delete_trigger(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for delete_trigger - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_delete_trigger_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_delete_trigger` interceptor runs + before the `post_delete_trigger_with_metadata` interceptor. """ return response + def post_delete_trigger_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for delete_trigger + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_delete_trigger_with_metadata` + interceptor in new development instead of the `post_delete_trigger` interceptor. + When both interceptors are used, this `post_delete_trigger_with_metadata` interceptor runs after the + `post_delete_trigger` interceptor. The (possibly modified) response returned by + `post_delete_trigger` will be passed to + `post_delete_trigger_with_metadata`. + """ + return response, metadata + def pre_get_channel(self, request: eventarc.GetChannelRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.GetChannelRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for get_channel @@ -346,12 +460,31 @@ def pre_get_channel(self, request: eventarc.GetChannelRequest, metadata: Sequenc def post_get_channel(self, response: channel.Channel) -> channel.Channel: """Post-rpc interceptor for get_channel - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_get_channel_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_get_channel` interceptor runs + before the `post_get_channel_with_metadata` interceptor. """ return response + def post_get_channel_with_metadata(self, response: channel.Channel, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[channel.Channel, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get_channel + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_get_channel_with_metadata` + interceptor in new development instead of the `post_get_channel` interceptor. + When both interceptors are used, this `post_get_channel_with_metadata` interceptor runs after the + `post_get_channel` interceptor. The (possibly modified) response returned by + `post_get_channel` will be passed to + `post_get_channel_with_metadata`. + """ + return response, metadata + def pre_get_channel_connection(self, request: eventarc.GetChannelConnectionRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.GetChannelConnectionRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for get_channel_connection @@ -363,12 +496,31 @@ def pre_get_channel_connection(self, request: eventarc.GetChannelConnectionReque def post_get_channel_connection(self, response: channel_connection.ChannelConnection) -> channel_connection.ChannelConnection: """Post-rpc interceptor for get_channel_connection - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_get_channel_connection_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_get_channel_connection` interceptor runs + before the `post_get_channel_connection_with_metadata` interceptor. """ return response + def post_get_channel_connection_with_metadata(self, response: channel_connection.ChannelConnection, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[channel_connection.ChannelConnection, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get_channel_connection + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_get_channel_connection_with_metadata` + interceptor in new development instead of the `post_get_channel_connection` interceptor. + When both interceptors are used, this `post_get_channel_connection_with_metadata` interceptor runs after the + `post_get_channel_connection` interceptor. The (possibly modified) response returned by + `post_get_channel_connection` will be passed to + `post_get_channel_connection_with_metadata`. + """ + return response, metadata + def pre_get_google_channel_config(self, request: eventarc.GetGoogleChannelConfigRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.GetGoogleChannelConfigRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for get_google_channel_config @@ -380,12 +532,31 @@ def pre_get_google_channel_config(self, request: eventarc.GetGoogleChannelConfig def post_get_google_channel_config(self, response: google_channel_config.GoogleChannelConfig) -> google_channel_config.GoogleChannelConfig: """Post-rpc interceptor for get_google_channel_config - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_get_google_channel_config_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_get_google_channel_config` interceptor runs + before the `post_get_google_channel_config_with_metadata` interceptor. """ return response + def post_get_google_channel_config_with_metadata(self, response: google_channel_config.GoogleChannelConfig, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[google_channel_config.GoogleChannelConfig, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get_google_channel_config + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_get_google_channel_config_with_metadata` + interceptor in new development instead of the `post_get_google_channel_config` interceptor. + When both interceptors are used, this `post_get_google_channel_config_with_metadata` interceptor runs after the + `post_get_google_channel_config` interceptor. The (possibly modified) response returned by + `post_get_google_channel_config` will be passed to + `post_get_google_channel_config_with_metadata`. + """ + return response, metadata + def pre_get_provider(self, request: eventarc.GetProviderRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.GetProviderRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for get_provider @@ -397,12 +568,31 @@ def pre_get_provider(self, request: eventarc.GetProviderRequest, metadata: Seque def post_get_provider(self, response: discovery.Provider) -> discovery.Provider: """Post-rpc interceptor for get_provider - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_get_provider_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_get_provider` interceptor runs + before the `post_get_provider_with_metadata` interceptor. """ return response + def post_get_provider_with_metadata(self, response: discovery.Provider, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[discovery.Provider, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get_provider + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_get_provider_with_metadata` + interceptor in new development instead of the `post_get_provider` interceptor. + When both interceptors are used, this `post_get_provider_with_metadata` interceptor runs after the + `post_get_provider` interceptor. The (possibly modified) response returned by + `post_get_provider` will be passed to + `post_get_provider_with_metadata`. + """ + return response, metadata + def pre_get_trigger(self, request: eventarc.GetTriggerRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.GetTriggerRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for get_trigger @@ -414,12 +604,31 @@ def pre_get_trigger(self, request: eventarc.GetTriggerRequest, metadata: Sequenc def post_get_trigger(self, response: trigger.Trigger) -> trigger.Trigger: """Post-rpc interceptor for get_trigger - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_get_trigger_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_get_trigger` interceptor runs + before the `post_get_trigger_with_metadata` interceptor. """ return response + def post_get_trigger_with_metadata(self, response: trigger.Trigger, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[trigger.Trigger, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get_trigger + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_get_trigger_with_metadata` + interceptor in new development instead of the `post_get_trigger` interceptor. + When both interceptors are used, this `post_get_trigger_with_metadata` interceptor runs after the + `post_get_trigger` interceptor. The (possibly modified) response returned by + `post_get_trigger` will be passed to + `post_get_trigger_with_metadata`. + """ + return response, metadata + def pre_list_channel_connections(self, request: eventarc.ListChannelConnectionsRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.ListChannelConnectionsRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for list_channel_connections @@ -431,12 +640,31 @@ def pre_list_channel_connections(self, request: eventarc.ListChannelConnectionsR def post_list_channel_connections(self, response: eventarc.ListChannelConnectionsResponse) -> eventarc.ListChannelConnectionsResponse: """Post-rpc interceptor for list_channel_connections - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_list_channel_connections_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_list_channel_connections` interceptor runs + before the `post_list_channel_connections_with_metadata` interceptor. """ return response + def post_list_channel_connections_with_metadata(self, response: eventarc.ListChannelConnectionsResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.ListChannelConnectionsResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for list_channel_connections + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_list_channel_connections_with_metadata` + interceptor in new development instead of the `post_list_channel_connections` interceptor. + When both interceptors are used, this `post_list_channel_connections_with_metadata` interceptor runs after the + `post_list_channel_connections` interceptor. The (possibly modified) response returned by + `post_list_channel_connections` will be passed to + `post_list_channel_connections_with_metadata`. + """ + return response, metadata + def pre_list_channels(self, request: eventarc.ListChannelsRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.ListChannelsRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for list_channels @@ -448,12 +676,31 @@ def pre_list_channels(self, request: eventarc.ListChannelsRequest, metadata: Seq def post_list_channels(self, response: eventarc.ListChannelsResponse) -> eventarc.ListChannelsResponse: """Post-rpc interceptor for list_channels - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_list_channels_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_list_channels` interceptor runs + before the `post_list_channels_with_metadata` interceptor. """ return response + def post_list_channels_with_metadata(self, response: eventarc.ListChannelsResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.ListChannelsResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for list_channels + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_list_channels_with_metadata` + interceptor in new development instead of the `post_list_channels` interceptor. + When both interceptors are used, this `post_list_channels_with_metadata` interceptor runs after the + `post_list_channels` interceptor. The (possibly modified) response returned by + `post_list_channels` will be passed to + `post_list_channels_with_metadata`. + """ + return response, metadata + def pre_list_providers(self, request: eventarc.ListProvidersRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.ListProvidersRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for list_providers @@ -465,12 +712,31 @@ def pre_list_providers(self, request: eventarc.ListProvidersRequest, metadata: S def post_list_providers(self, response: eventarc.ListProvidersResponse) -> eventarc.ListProvidersResponse: """Post-rpc interceptor for list_providers - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_list_providers_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_list_providers` interceptor runs + before the `post_list_providers_with_metadata` interceptor. """ return response + def post_list_providers_with_metadata(self, response: eventarc.ListProvidersResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.ListProvidersResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for list_providers + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_list_providers_with_metadata` + interceptor in new development instead of the `post_list_providers` interceptor. + When both interceptors are used, this `post_list_providers_with_metadata` interceptor runs after the + `post_list_providers` interceptor. The (possibly modified) response returned by + `post_list_providers` will be passed to + `post_list_providers_with_metadata`. + """ + return response, metadata + def pre_list_triggers(self, request: eventarc.ListTriggersRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.ListTriggersRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for list_triggers @@ -482,12 +748,31 @@ def pre_list_triggers(self, request: eventarc.ListTriggersRequest, metadata: Seq def post_list_triggers(self, response: eventarc.ListTriggersResponse) -> eventarc.ListTriggersResponse: """Post-rpc interceptor for list_triggers - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_list_triggers_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_list_triggers` interceptor runs + before the `post_list_triggers_with_metadata` interceptor. """ return response + def post_list_triggers_with_metadata(self, response: eventarc.ListTriggersResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.ListTriggersResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for list_triggers + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_list_triggers_with_metadata` + interceptor in new development instead of the `post_list_triggers` interceptor. + When both interceptors are used, this `post_list_triggers_with_metadata` interceptor runs after the + `post_list_triggers` interceptor. The (possibly modified) response returned by + `post_list_triggers` will be passed to + `post_list_triggers_with_metadata`. + """ + return response, metadata + def pre_update_channel(self, request: eventarc.UpdateChannelRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.UpdateChannelRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for update_channel @@ -499,12 +784,31 @@ def pre_update_channel(self, request: eventarc.UpdateChannelRequest, metadata: S def post_update_channel(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for update_channel - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_update_channel_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_update_channel` interceptor runs + before the `post_update_channel_with_metadata` interceptor. """ return response + def post_update_channel_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for update_channel + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_update_channel_with_metadata` + interceptor in new development instead of the `post_update_channel` interceptor. + When both interceptors are used, this `post_update_channel_with_metadata` interceptor runs after the + `post_update_channel` interceptor. The (possibly modified) response returned by + `post_update_channel` will be passed to + `post_update_channel_with_metadata`. + """ + return response, metadata + def pre_update_google_channel_config(self, request: eventarc.UpdateGoogleChannelConfigRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.UpdateGoogleChannelConfigRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for update_google_channel_config @@ -516,12 +820,31 @@ def pre_update_google_channel_config(self, request: eventarc.UpdateGoogleChannel def post_update_google_channel_config(self, response: gce_google_channel_config.GoogleChannelConfig) -> gce_google_channel_config.GoogleChannelConfig: """Post-rpc interceptor for update_google_channel_config - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_update_google_channel_config_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_update_google_channel_config` interceptor runs + before the `post_update_google_channel_config_with_metadata` interceptor. """ return response + def post_update_google_channel_config_with_metadata(self, response: gce_google_channel_config.GoogleChannelConfig, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[gce_google_channel_config.GoogleChannelConfig, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for update_google_channel_config + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_update_google_channel_config_with_metadata` + interceptor in new development instead of the `post_update_google_channel_config` interceptor. + When both interceptors are used, this `post_update_google_channel_config_with_metadata` interceptor runs after the + `post_update_google_channel_config` interceptor. The (possibly modified) response returned by + `post_update_google_channel_config` will be passed to + `post_update_google_channel_config_with_metadata`. + """ + return response, metadata + def pre_update_trigger(self, request: eventarc.UpdateTriggerRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[eventarc.UpdateTriggerRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for update_trigger @@ -533,12 +856,31 @@ def pre_update_trigger(self, request: eventarc.UpdateTriggerRequest, metadata: S def post_update_trigger(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for update_trigger - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_update_trigger_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the Eventarc server but before - it is returned to user code. + it is returned to user code. This `post_update_trigger` interceptor runs + before the `post_update_trigger_with_metadata` interceptor. """ return response + def post_update_trigger_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for update_trigger + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the Eventarc server but before it is returned to user code. + + We recommend only using this `post_update_trigger_with_metadata` + interceptor in new development instead of the `post_update_trigger` interceptor. + When both interceptors are used, this `post_update_trigger_with_metadata` interceptor runs after the + `post_update_trigger` interceptor. The (possibly modified) response returned by + `post_update_trigger` will be passed to + `post_update_trigger_with_metadata`. + """ + return response, metadata + def pre_get_location( self, request: locations_pb2.GetLocationRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]] ) -> Tuple[locations_pb2.GetLocationRequest, Sequence[Tuple[str, Union[str, bytes]]]]: @@ -971,6 +1313,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_create_channel(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_create_channel_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -1093,6 +1437,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_create_channel_connection(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_create_channel_connection_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -1215,6 +1561,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_create_trigger(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_create_trigger_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -1334,6 +1682,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_delete_channel(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_delete_channel_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -1453,6 +1803,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_delete_channel_connection(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_delete_channel_connection_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -1572,6 +1924,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_delete_trigger(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_delete_trigger_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -1698,6 +2052,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_get_channel(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_channel_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = channel.Channel.to_json(response) @@ -1823,6 +2179,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_get_channel_connection(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_channel_connection_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = channel_connection.ChannelConnection.to_json(response) @@ -1949,6 +2307,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_get_google_channel_config(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_google_channel_config_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = google_channel_config.GoogleChannelConfig.to_json(response) @@ -2069,6 +2429,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_get_provider(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_provider_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = discovery.Provider.to_json(response) @@ -2189,6 +2551,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_get_trigger(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_trigger_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = trigger.Trigger.to_json(response) @@ -2309,6 +2673,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_list_channel_connections(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_channel_connections_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = eventarc.ListChannelConnectionsResponse.to_json(response) @@ -2427,6 +2793,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_list_channels(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_channels_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = eventarc.ListChannelsResponse.to_json(response) @@ -2545,6 +2913,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_list_providers(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_providers_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = eventarc.ListProvidersResponse.to_json(response) @@ -2663,6 +3033,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_list_triggers(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_triggers_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = eventarc.ListTriggersResponse.to_json(response) @@ -2785,6 +3157,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_update_channel(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_update_channel_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -2915,6 +3289,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_update_google_channel_config(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_update_google_channel_config_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = gce_google_channel_config.GoogleChannelConfig.to_json(response) @@ -3037,6 +3413,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_update_trigger(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_update_trigger_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) diff --git a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py index 42bc23df8..6473ef989 100755 --- a/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py +++ b/tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/test_eventarc.py @@ -11842,9 +11842,11 @@ def test_get_trigger_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.EventarcRestInterceptor, "post_get_trigger") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_get_trigger_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_get_trigger") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.GetTriggerRequest.pb(eventarc.GetTriggerRequest()) transcode.return_value = { "method": "post", @@ -11866,11 +11868,13 @@ def test_get_trigger_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = trigger.Trigger() + post_with_metadata.return_value = trigger.Trigger(), metadata client.get_trigger(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_list_triggers_rest_bad_request(request_type=eventarc.ListTriggersRequest): @@ -11946,9 +11950,11 @@ def test_list_triggers_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.EventarcRestInterceptor, "post_list_triggers") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_list_triggers_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_list_triggers") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.ListTriggersRequest.pb(eventarc.ListTriggersRequest()) transcode.return_value = { "method": "post", @@ -11970,11 +11976,13 @@ def test_list_triggers_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = eventarc.ListTriggersResponse() + post_with_metadata.return_value = eventarc.ListTriggersResponse(), metadata client.list_triggers(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_create_trigger_rest_bad_request(request_type=eventarc.CreateTriggerRequest): @@ -12107,9 +12115,11 @@ def test_create_trigger_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.EventarcRestInterceptor, "post_create_trigger") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_create_trigger_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_create_trigger") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.CreateTriggerRequest.pb(eventarc.CreateTriggerRequest()) transcode.return_value = { "method": "post", @@ -12131,11 +12141,13 @@ def test_create_trigger_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.create_trigger(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_update_trigger_rest_bad_request(request_type=eventarc.UpdateTriggerRequest): @@ -12268,9 +12280,11 @@ def test_update_trigger_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.EventarcRestInterceptor, "post_update_trigger") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_update_trigger_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_update_trigger") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.UpdateTriggerRequest.pb(eventarc.UpdateTriggerRequest()) transcode.return_value = { "method": "post", @@ -12292,11 +12306,13 @@ def test_update_trigger_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.update_trigger(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_delete_trigger_rest_bad_request(request_type=eventarc.DeleteTriggerRequest): @@ -12365,9 +12381,11 @@ def test_delete_trigger_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.EventarcRestInterceptor, "post_delete_trigger") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_delete_trigger_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_delete_trigger") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.DeleteTriggerRequest.pb(eventarc.DeleteTriggerRequest()) transcode.return_value = { "method": "post", @@ -12389,11 +12407,13 @@ def test_delete_trigger_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.delete_trigger(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_get_channel_rest_bad_request(request_type=eventarc.GetChannelRequest): @@ -12478,9 +12498,11 @@ def test_get_channel_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.EventarcRestInterceptor, "post_get_channel") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_get_channel_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_get_channel") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.GetChannelRequest.pb(eventarc.GetChannelRequest()) transcode.return_value = { "method": "post", @@ -12502,11 +12524,13 @@ def test_get_channel_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = channel.Channel() + post_with_metadata.return_value = channel.Channel(), metadata client.get_channel(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_list_channels_rest_bad_request(request_type=eventarc.ListChannelsRequest): @@ -12582,9 +12606,11 @@ def test_list_channels_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.EventarcRestInterceptor, "post_list_channels") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_list_channels_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_list_channels") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.ListChannelsRequest.pb(eventarc.ListChannelsRequest()) transcode.return_value = { "method": "post", @@ -12606,11 +12632,13 @@ def test_list_channels_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = eventarc.ListChannelsResponse() + post_with_metadata.return_value = eventarc.ListChannelsResponse(), metadata client.list_channels(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_create_channel_rest_bad_request(request_type=eventarc.CreateChannelRequest): @@ -12743,9 +12771,11 @@ def test_create_channel_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.EventarcRestInterceptor, "post_create_channel") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_create_channel_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_create_channel") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.CreateChannelRequest.pb(eventarc.CreateChannelRequest()) transcode.return_value = { "method": "post", @@ -12767,11 +12797,13 @@ def test_create_channel_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.create_channel(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_update_channel_rest_bad_request(request_type=eventarc.UpdateChannelRequest): @@ -12904,9 +12936,11 @@ def test_update_channel_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.EventarcRestInterceptor, "post_update_channel") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_update_channel_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_update_channel") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.UpdateChannelRequest.pb(eventarc.UpdateChannelRequest()) transcode.return_value = { "method": "post", @@ -12928,11 +12962,13 @@ def test_update_channel_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.update_channel(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_delete_channel_rest_bad_request(request_type=eventarc.DeleteChannelRequest): @@ -13001,9 +13037,11 @@ def test_delete_channel_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.EventarcRestInterceptor, "post_delete_channel") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_delete_channel_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_delete_channel") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.DeleteChannelRequest.pb(eventarc.DeleteChannelRequest()) transcode.return_value = { "method": "post", @@ -13025,11 +13063,13 @@ def test_delete_channel_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.delete_channel(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_get_provider_rest_bad_request(request_type=eventarc.GetProviderRequest): @@ -13105,9 +13145,11 @@ def test_get_provider_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.EventarcRestInterceptor, "post_get_provider") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_get_provider_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_get_provider") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.GetProviderRequest.pb(eventarc.GetProviderRequest()) transcode.return_value = { "method": "post", @@ -13129,11 +13171,13 @@ def test_get_provider_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = discovery.Provider() + post_with_metadata.return_value = discovery.Provider(), metadata client.get_provider(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_list_providers_rest_bad_request(request_type=eventarc.ListProvidersRequest): @@ -13209,9 +13253,11 @@ def test_list_providers_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.EventarcRestInterceptor, "post_list_providers") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_list_providers_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_list_providers") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.ListProvidersRequest.pb(eventarc.ListProvidersRequest()) transcode.return_value = { "method": "post", @@ -13233,11 +13279,13 @@ def test_list_providers_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = eventarc.ListProvidersResponse() + post_with_metadata.return_value = eventarc.ListProvidersResponse(), metadata client.list_providers(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_get_channel_connection_rest_bad_request(request_type=eventarc.GetChannelConnectionRequest): @@ -13317,9 +13365,11 @@ def test_get_channel_connection_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.EventarcRestInterceptor, "post_get_channel_connection") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_get_channel_connection_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_get_channel_connection") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.GetChannelConnectionRequest.pb(eventarc.GetChannelConnectionRequest()) transcode.return_value = { "method": "post", @@ -13341,11 +13391,13 @@ def test_get_channel_connection_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = channel_connection.ChannelConnection() + post_with_metadata.return_value = channel_connection.ChannelConnection(), metadata client.get_channel_connection(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_list_channel_connections_rest_bad_request(request_type=eventarc.ListChannelConnectionsRequest): @@ -13421,9 +13473,11 @@ def test_list_channel_connections_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.EventarcRestInterceptor, "post_list_channel_connections") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_list_channel_connections_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_list_channel_connections") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.ListChannelConnectionsRequest.pb(eventarc.ListChannelConnectionsRequest()) transcode.return_value = { "method": "post", @@ -13445,11 +13499,13 @@ def test_list_channel_connections_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = eventarc.ListChannelConnectionsResponse() + post_with_metadata.return_value = eventarc.ListChannelConnectionsResponse(), metadata client.list_channel_connections(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_create_channel_connection_rest_bad_request(request_type=eventarc.CreateChannelConnectionRequest): @@ -13582,9 +13638,11 @@ def test_create_channel_connection_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.EventarcRestInterceptor, "post_create_channel_connection") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_create_channel_connection_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_create_channel_connection") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.CreateChannelConnectionRequest.pb(eventarc.CreateChannelConnectionRequest()) transcode.return_value = { "method": "post", @@ -13606,11 +13664,13 @@ def test_create_channel_connection_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.create_channel_connection(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_delete_channel_connection_rest_bad_request(request_type=eventarc.DeleteChannelConnectionRequest): @@ -13679,9 +13739,11 @@ def test_delete_channel_connection_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.EventarcRestInterceptor, "post_delete_channel_connection") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_delete_channel_connection_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_delete_channel_connection") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.DeleteChannelConnectionRequest.pb(eventarc.DeleteChannelConnectionRequest()) transcode.return_value = { "method": "post", @@ -13703,11 +13765,13 @@ def test_delete_channel_connection_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.delete_channel_connection(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_get_google_channel_config_rest_bad_request(request_type=eventarc.GetGoogleChannelConfigRequest): @@ -13783,9 +13847,11 @@ def test_get_google_channel_config_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.EventarcRestInterceptor, "post_get_google_channel_config") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_get_google_channel_config_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_get_google_channel_config") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.GetGoogleChannelConfigRequest.pb(eventarc.GetGoogleChannelConfigRequest()) transcode.return_value = { "method": "post", @@ -13807,11 +13873,13 @@ def test_get_google_channel_config_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = google_channel_config.GoogleChannelConfig() + post_with_metadata.return_value = google_channel_config.GoogleChannelConfig(), metadata client.get_google_channel_config(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_update_google_channel_config_rest_bad_request(request_type=eventarc.UpdateGoogleChannelConfigRequest): @@ -13951,9 +14019,11 @@ def test_update_google_channel_config_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.EventarcRestInterceptor, "post_update_google_channel_config") as post, \ + mock.patch.object(transports.EventarcRestInterceptor, "post_update_google_channel_config_with_metadata") as post_with_metadata, \ mock.patch.object(transports.EventarcRestInterceptor, "pre_update_google_channel_config") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = eventarc.UpdateGoogleChannelConfigRequest.pb(eventarc.UpdateGoogleChannelConfigRequest()) transcode.return_value = { "method": "post", @@ -13975,11 +14045,13 @@ def test_update_google_channel_config_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = gce_google_channel_config.GoogleChannelConfig() + post_with_metadata.return_value = gce_google_channel_config.GoogleChannelConfig(), metadata client.update_google_channel_config(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_get_location_rest_bad_request(request_type=locations_pb2.GetLocationRequest): diff --git a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/transports/rest.py b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/transports/rest.py index 13a03f6e2..7b3fbccb9 100755 --- a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/transports/rest.py +++ b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/transports/rest.py @@ -132,12 +132,31 @@ def pre_create_instance(self, request: cloud_redis.CreateInstanceRequest, metada def post_create_instance(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for create_instance - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_create_instance_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the CloudRedis server but before - it is returned to user code. + it is returned to user code. This `post_create_instance` interceptor runs + before the `post_create_instance_with_metadata` interceptor. """ return response + def post_create_instance_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for create_instance + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the CloudRedis server but before it is returned to user code. + + We recommend only using this `post_create_instance_with_metadata` + interceptor in new development instead of the `post_create_instance` interceptor. + When both interceptors are used, this `post_create_instance_with_metadata` interceptor runs after the + `post_create_instance` interceptor. The (possibly modified) response returned by + `post_create_instance` will be passed to + `post_create_instance_with_metadata`. + """ + return response, metadata + def pre_delete_instance(self, request: cloud_redis.DeleteInstanceRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.DeleteInstanceRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for delete_instance @@ -149,12 +168,31 @@ def pre_delete_instance(self, request: cloud_redis.DeleteInstanceRequest, metada def post_delete_instance(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for delete_instance - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_delete_instance_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the CloudRedis server but before - it is returned to user code. + it is returned to user code. This `post_delete_instance` interceptor runs + before the `post_delete_instance_with_metadata` interceptor. """ return response + def post_delete_instance_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for delete_instance + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the CloudRedis server but before it is returned to user code. + + We recommend only using this `post_delete_instance_with_metadata` + interceptor in new development instead of the `post_delete_instance` interceptor. + When both interceptors are used, this `post_delete_instance_with_metadata` interceptor runs after the + `post_delete_instance` interceptor. The (possibly modified) response returned by + `post_delete_instance` will be passed to + `post_delete_instance_with_metadata`. + """ + return response, metadata + def pre_get_instance(self, request: cloud_redis.GetInstanceRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.GetInstanceRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for get_instance @@ -166,12 +204,31 @@ def pre_get_instance(self, request: cloud_redis.GetInstanceRequest, metadata: Se def post_get_instance(self, response: cloud_redis.Instance) -> cloud_redis.Instance: """Post-rpc interceptor for get_instance - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_get_instance_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the CloudRedis server but before - it is returned to user code. + it is returned to user code. This `post_get_instance` interceptor runs + before the `post_get_instance_with_metadata` interceptor. """ return response + def post_get_instance_with_metadata(self, response: cloud_redis.Instance, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.Instance, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get_instance + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the CloudRedis server but before it is returned to user code. + + We recommend only using this `post_get_instance_with_metadata` + interceptor in new development instead of the `post_get_instance` interceptor. + When both interceptors are used, this `post_get_instance_with_metadata` interceptor runs after the + `post_get_instance` interceptor. The (possibly modified) response returned by + `post_get_instance` will be passed to + `post_get_instance_with_metadata`. + """ + return response, metadata + def pre_list_instances(self, request: cloud_redis.ListInstancesRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.ListInstancesRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for list_instances @@ -183,12 +240,31 @@ def pre_list_instances(self, request: cloud_redis.ListInstancesRequest, metadata def post_list_instances(self, response: cloud_redis.ListInstancesResponse) -> cloud_redis.ListInstancesResponse: """Post-rpc interceptor for list_instances - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_list_instances_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the CloudRedis server but before - it is returned to user code. + it is returned to user code. This `post_list_instances` interceptor runs + before the `post_list_instances_with_metadata` interceptor. """ return response + def post_list_instances_with_metadata(self, response: cloud_redis.ListInstancesResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.ListInstancesResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for list_instances + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the CloudRedis server but before it is returned to user code. + + We recommend only using this `post_list_instances_with_metadata` + interceptor in new development instead of the `post_list_instances` interceptor. + When both interceptors are used, this `post_list_instances_with_metadata` interceptor runs after the + `post_list_instances` interceptor. The (possibly modified) response returned by + `post_list_instances` will be passed to + `post_list_instances_with_metadata`. + """ + return response, metadata + def pre_update_instance(self, request: cloud_redis.UpdateInstanceRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.UpdateInstanceRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for update_instance @@ -200,12 +276,31 @@ def pre_update_instance(self, request: cloud_redis.UpdateInstanceRequest, metada def post_update_instance(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for update_instance - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_update_instance_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the CloudRedis server but before - it is returned to user code. + it is returned to user code. This `post_update_instance` interceptor runs + before the `post_update_instance_with_metadata` interceptor. """ return response + def post_update_instance_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for update_instance + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the CloudRedis server but before it is returned to user code. + + We recommend only using this `post_update_instance_with_metadata` + interceptor in new development instead of the `post_update_instance` interceptor. + When both interceptors are used, this `post_update_instance_with_metadata` interceptor runs after the + `post_update_instance` interceptor. The (possibly modified) response returned by + `post_update_instance` will be passed to + `post_update_instance_with_metadata`. + """ + return response, metadata + def pre_get_location( self, request: locations_pb2.GetLocationRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]] ) -> Tuple[locations_pb2.GetLocationRequest, Sequence[Tuple[str, Union[str, bytes]]]]: @@ -620,6 +715,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_create_instance(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_create_instance_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -739,6 +836,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_delete_instance(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_delete_instance_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -857,6 +956,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_get_instance(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_instance_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = cloud_redis.Instance.to_json(response) @@ -977,6 +1078,8 @@ def __call__(self, json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) resp = self._interceptor.post_list_instances(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_instances_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = cloud_redis.ListInstancesResponse.to_json(response) @@ -1099,6 +1202,8 @@ def __call__(self, json_format.Parse(response.content, resp, ignore_unknown_fields=True) resp = self._interceptor.post_update_instance(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_update_instance_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) diff --git a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/transports/rest_asyncio.py b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/transports/rest_asyncio.py index 26e787e58..8028c4273 100755 --- a/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/transports/rest_asyncio.py +++ b/tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/transports/rest_asyncio.py @@ -145,12 +145,31 @@ async def pre_create_instance(self, request: cloud_redis.CreateInstanceRequest, async def post_create_instance(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for create_instance - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_create_instance_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the CloudRedis server but before - it is returned to user code. + it is returned to user code. This `post_create_instance` interceptor runs + before the `post_create_instance_with_metadata` interceptor. """ return response + async def post_create_instance_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for create_instance + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the CloudRedis server but before it is returned to user code. + + We recommend only using this `post_create_instance_with_metadata` + interceptor in new development instead of the `post_create_instance` interceptor. + When both interceptors are used, this `post_create_instance_with_metadata` interceptor runs after the + `post_create_instance` interceptor. The (possibly modified) response returned by + `post_create_instance` will be passed to + `post_create_instance_with_metadata`. + """ + return response, metadata + async def pre_delete_instance(self, request: cloud_redis.DeleteInstanceRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.DeleteInstanceRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for delete_instance @@ -162,12 +181,31 @@ async def pre_delete_instance(self, request: cloud_redis.DeleteInstanceRequest, async def post_delete_instance(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for delete_instance - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_delete_instance_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the CloudRedis server but before - it is returned to user code. + it is returned to user code. This `post_delete_instance` interceptor runs + before the `post_delete_instance_with_metadata` interceptor. """ return response + async def post_delete_instance_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for delete_instance + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the CloudRedis server but before it is returned to user code. + + We recommend only using this `post_delete_instance_with_metadata` + interceptor in new development instead of the `post_delete_instance` interceptor. + When both interceptors are used, this `post_delete_instance_with_metadata` interceptor runs after the + `post_delete_instance` interceptor. The (possibly modified) response returned by + `post_delete_instance` will be passed to + `post_delete_instance_with_metadata`. + """ + return response, metadata + async def pre_get_instance(self, request: cloud_redis.GetInstanceRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.GetInstanceRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for get_instance @@ -179,12 +217,31 @@ async def pre_get_instance(self, request: cloud_redis.GetInstanceRequest, metada async def post_get_instance(self, response: cloud_redis.Instance) -> cloud_redis.Instance: """Post-rpc interceptor for get_instance - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_get_instance_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the CloudRedis server but before - it is returned to user code. + it is returned to user code. This `post_get_instance` interceptor runs + before the `post_get_instance_with_metadata` interceptor. """ return response + async def post_get_instance_with_metadata(self, response: cloud_redis.Instance, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.Instance, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for get_instance + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the CloudRedis server but before it is returned to user code. + + We recommend only using this `post_get_instance_with_metadata` + interceptor in new development instead of the `post_get_instance` interceptor. + When both interceptors are used, this `post_get_instance_with_metadata` interceptor runs after the + `post_get_instance` interceptor. The (possibly modified) response returned by + `post_get_instance` will be passed to + `post_get_instance_with_metadata`. + """ + return response, metadata + async def pre_list_instances(self, request: cloud_redis.ListInstancesRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.ListInstancesRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for list_instances @@ -196,12 +253,31 @@ async def pre_list_instances(self, request: cloud_redis.ListInstancesRequest, me async def post_list_instances(self, response: cloud_redis.ListInstancesResponse) -> cloud_redis.ListInstancesResponse: """Post-rpc interceptor for list_instances - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_list_instances_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the CloudRedis server but before - it is returned to user code. + it is returned to user code. This `post_list_instances` interceptor runs + before the `post_list_instances_with_metadata` interceptor. """ return response + async def post_list_instances_with_metadata(self, response: cloud_redis.ListInstancesResponse, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.ListInstancesResponse, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for list_instances + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the CloudRedis server but before it is returned to user code. + + We recommend only using this `post_list_instances_with_metadata` + interceptor in new development instead of the `post_list_instances` interceptor. + When both interceptors are used, this `post_list_instances_with_metadata` interceptor runs after the + `post_list_instances` interceptor. The (possibly modified) response returned by + `post_list_instances` will be passed to + `post_list_instances_with_metadata`. + """ + return response, metadata + async def pre_update_instance(self, request: cloud_redis.UpdateInstanceRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[cloud_redis.UpdateInstanceRequest, Sequence[Tuple[str, Union[str, bytes]]]]: """Pre-rpc interceptor for update_instance @@ -213,12 +289,31 @@ async def pre_update_instance(self, request: cloud_redis.UpdateInstanceRequest, async def post_update_instance(self, response: operations_pb2.Operation) -> operations_pb2.Operation: """Post-rpc interceptor for update_instance - Override in a subclass to manipulate the response + DEPRECATED. Please use the `post_update_instance_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response after it is returned by the CloudRedis server but before - it is returned to user code. + it is returned to user code. This `post_update_instance` interceptor runs + before the `post_update_instance_with_metadata` interceptor. """ return response + async def post_update_instance_with_metadata(self, response: operations_pb2.Operation, metadata: Sequence[Tuple[str, Union[str, bytes]]]) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for update_instance + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the CloudRedis server but before it is returned to user code. + + We recommend only using this `post_update_instance_with_metadata` + interceptor in new development instead of the `post_update_instance` interceptor. + When both interceptors are used, this `post_update_instance_with_metadata` interceptor runs after the + `post_update_instance` interceptor. The (possibly modified) response returned by + `post_update_instance` will be passed to + `post_update_instance_with_metadata`. + """ + return response, metadata + async def pre_get_location( self, request: locations_pb2.GetLocationRequest, metadata: Sequence[Tuple[str, Union[str, bytes]]] ) -> Tuple[locations_pb2.GetLocationRequest, Sequence[Tuple[str, Union[str, bytes]]]]: @@ -626,6 +721,8 @@ async def __call__(self, content = await response.read() json_format.Parse(content, pb_resp, ignore_unknown_fields=True) resp = await self._interceptor.post_create_instance(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = await self._interceptor.post_create_instance_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -751,6 +848,8 @@ async def __call__(self, content = await response.read() json_format.Parse(content, pb_resp, ignore_unknown_fields=True) resp = await self._interceptor.post_delete_instance(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = await self._interceptor.post_delete_instance_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) @@ -873,6 +972,8 @@ async def __call__(self, content = await response.read() json_format.Parse(content, pb_resp, ignore_unknown_fields=True) resp = await self._interceptor.post_get_instance(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = await self._interceptor.post_get_instance_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = cloud_redis.Instance.to_json(response) @@ -997,6 +1098,8 @@ async def __call__(self, content = await response.read() json_format.Parse(content, pb_resp, ignore_unknown_fields=True) resp = await self._interceptor.post_list_instances(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = await self._interceptor.post_list_instances_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = cloud_redis.ListInstancesResponse.to_json(response) @@ -1125,6 +1228,8 @@ async def __call__(self, content = await response.read() json_format.Parse(content, pb_resp, ignore_unknown_fields=True) resp = await self._interceptor.post_update_instance(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = await self._interceptor.post_update_instance_with_metadata(resp, response_metadata) if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(logging.DEBUG): # pragma: NO COVER try: response_payload = json_format.MessageToJson(resp) diff --git a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py index cf39e33d4..6b866780f 100755 --- a/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py +++ b/tests/integration/goldens/redis/tests/unit/gapic/redis_v1/test_cloud_redis.py @@ -4023,9 +4023,11 @@ def test_list_instances_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.CloudRedisRestInterceptor, "post_list_instances") as post, \ + mock.patch.object(transports.CloudRedisRestInterceptor, "post_list_instances_with_metadata") as post_with_metadata, \ mock.patch.object(transports.CloudRedisRestInterceptor, "pre_list_instances") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = cloud_redis.ListInstancesRequest.pb(cloud_redis.ListInstancesRequest()) transcode.return_value = { "method": "post", @@ -4047,11 +4049,13 @@ def test_list_instances_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = cloud_redis.ListInstancesResponse() + post_with_metadata.return_value = cloud_redis.ListInstancesResponse(), metadata client.list_instances(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_get_instance_rest_bad_request(request_type=cloud_redis.GetInstanceRequest): @@ -4177,9 +4181,11 @@ def test_get_instance_rest_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.CloudRedisRestInterceptor, "post_get_instance") as post, \ + mock.patch.object(transports.CloudRedisRestInterceptor, "post_get_instance_with_metadata") as post_with_metadata, \ mock.patch.object(transports.CloudRedisRestInterceptor, "pre_get_instance") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = cloud_redis.GetInstanceRequest.pb(cloud_redis.GetInstanceRequest()) transcode.return_value = { "method": "post", @@ -4201,11 +4207,13 @@ def test_get_instance_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = cloud_redis.Instance() + post_with_metadata.return_value = cloud_redis.Instance(), metadata client.get_instance(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_create_instance_rest_bad_request(request_type=cloud_redis.CreateInstanceRequest): @@ -4338,9 +4346,11 @@ def test_create_instance_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.CloudRedisRestInterceptor, "post_create_instance") as post, \ + mock.patch.object(transports.CloudRedisRestInterceptor, "post_create_instance_with_metadata") as post_with_metadata, \ mock.patch.object(transports.CloudRedisRestInterceptor, "pre_create_instance") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = cloud_redis.CreateInstanceRequest.pb(cloud_redis.CreateInstanceRequest()) transcode.return_value = { "method": "post", @@ -4362,11 +4372,13 @@ def test_create_instance_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.create_instance(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_update_instance_rest_bad_request(request_type=cloud_redis.UpdateInstanceRequest): @@ -4499,9 +4511,11 @@ def test_update_instance_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.CloudRedisRestInterceptor, "post_update_instance") as post, \ + mock.patch.object(transports.CloudRedisRestInterceptor, "post_update_instance_with_metadata") as post_with_metadata, \ mock.patch.object(transports.CloudRedisRestInterceptor, "pre_update_instance") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = cloud_redis.UpdateInstanceRequest.pb(cloud_redis.UpdateInstanceRequest()) transcode.return_value = { "method": "post", @@ -4523,11 +4537,13 @@ def test_update_instance_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.update_instance(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_delete_instance_rest_bad_request(request_type=cloud_redis.DeleteInstanceRequest): @@ -4596,9 +4612,11 @@ def test_delete_instance_rest_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.CloudRedisRestInterceptor, "post_delete_instance") as post, \ + mock.patch.object(transports.CloudRedisRestInterceptor, "post_delete_instance_with_metadata") as post_with_metadata, \ mock.patch.object(transports.CloudRedisRestInterceptor, "pre_delete_instance") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = cloud_redis.DeleteInstanceRequest.pb(cloud_redis.DeleteInstanceRequest()) transcode.return_value = { "method": "post", @@ -4620,11 +4638,13 @@ def test_delete_instance_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata client.delete_instance(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() def test_get_location_rest_bad_request(request_type=locations_pb2.GetLocationRequest): @@ -5221,9 +5241,11 @@ async def test_list_instances_rest_asyncio_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "post_list_instances") as post, \ + mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "post_list_instances_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "pre_list_instances") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = cloud_redis.ListInstancesRequest.pb(cloud_redis.ListInstancesRequest()) transcode.return_value = { "method": "post", @@ -5245,11 +5267,13 @@ async def test_list_instances_rest_asyncio_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = cloud_redis.ListInstancesResponse() + post_with_metadata.return_value = cloud_redis.ListInstancesResponse(), metadata await client.list_instances(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() @pytest.mark.asyncio async def test_get_instance_rest_asyncio_bad_request(request_type=cloud_redis.GetInstanceRequest): @@ -5382,9 +5406,11 @@ async def test_get_instance_rest_asyncio_interceptors(null_interceptor): with mock.patch.object(type(client.transport._session), "request") as req, \ mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "post_get_instance") as post, \ + mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "post_get_instance_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "pre_get_instance") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = cloud_redis.GetInstanceRequest.pb(cloud_redis.GetInstanceRequest()) transcode.return_value = { "method": "post", @@ -5406,11 +5432,13 @@ async def test_get_instance_rest_asyncio_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = cloud_redis.Instance() + post_with_metadata.return_value = cloud_redis.Instance(), metadata await client.get_instance(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() @pytest.mark.asyncio async def test_create_instance_rest_asyncio_bad_request(request_type=cloud_redis.CreateInstanceRequest): @@ -5550,9 +5578,11 @@ async def test_create_instance_rest_asyncio_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "post_create_instance") as post, \ + mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "post_create_instance_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "pre_create_instance") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = cloud_redis.CreateInstanceRequest.pb(cloud_redis.CreateInstanceRequest()) transcode.return_value = { "method": "post", @@ -5574,11 +5604,13 @@ async def test_create_instance_rest_asyncio_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata await client.create_instance(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() @pytest.mark.asyncio async def test_update_instance_rest_asyncio_bad_request(request_type=cloud_redis.UpdateInstanceRequest): @@ -5718,9 +5750,11 @@ async def test_update_instance_rest_asyncio_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "post_update_instance") as post, \ + mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "post_update_instance_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "pre_update_instance") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = cloud_redis.UpdateInstanceRequest.pb(cloud_redis.UpdateInstanceRequest()) transcode.return_value = { "method": "post", @@ -5742,11 +5776,13 @@ async def test_update_instance_rest_asyncio_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata await client.update_instance(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() @pytest.mark.asyncio async def test_delete_instance_rest_asyncio_bad_request(request_type=cloud_redis.DeleteInstanceRequest): @@ -5822,9 +5858,11 @@ async def test_delete_instance_rest_asyncio_interceptors(null_interceptor): mock.patch.object(path_template, "transcode") as transcode, \ mock.patch.object(operation.Operation, "_set_result_from_operation"), \ mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "post_delete_instance") as post, \ + mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "post_delete_instance_with_metadata") as post_with_metadata, \ mock.patch.object(transports.AsyncCloudRedisRestInterceptor, "pre_delete_instance") as pre: pre.assert_not_called() post.assert_not_called() + post_with_metadata.assert_not_called() pb_message = cloud_redis.DeleteInstanceRequest.pb(cloud_redis.DeleteInstanceRequest()) transcode.return_value = { "method": "post", @@ -5846,11 +5884,13 @@ async def test_delete_instance_rest_asyncio_interceptors(null_interceptor): ] pre.return_value = request, metadata post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata await client.delete_instance(request, metadata=[("key", "val"), ("cephalopod", "squid"),]) pre.assert_called_once() post.assert_called_once() + post_with_metadata.assert_called_once() @pytest.mark.asyncio async def test_get_location_rest_asyncio_bad_request(request_type=locations_pb2.GetLocationRequest):