From 8ceeaae796c9771ff1489acba0f8a4a749ac328e Mon Sep 17 00:00:00 2001 From: Victor Chudnovsky Date: Mon, 9 Dec 2024 09:50:25 -0800 Subject: [PATCH] chore(logging): standardize logging in _shared_macros (#2277) --- .../%sub/services/%service/_shared_macros.j2 | 10 +- .../services/asset_service/transports/rest.py | 170 ++++++++------- .../iam_credentials/transports/rest.py | 28 +-- .../services/eventarc/transports/rest.py | 203 ++++++++++-------- .../services/cloud_redis/transports/rest.py | 136 +++++++----- .../cloud_redis/transports/rest_asyncio.py | 136 +++++++----- 6 files changed, 388 insertions(+), 295 deletions(-) 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 1623d1b11..287f4fac7 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 @@ -218,17 +218,19 @@ def _get_http_options(): request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for {{ service.meta.address.proto_package_versioned }}.{{ service.client_name }}.{{ method_name }}", + f"Sending request for {{ service.meta.address.proto_package_versioned }}.{{ service.client_name }}.{{ method_name }}", extra = { "serviceName": "{{ service.meta.address.proto }}", "rpcName": "{{ method_name }}", - "metadata": str(dict(metadata)), "httpRequest": http_request, + {# TODO(https://github.com/googleapis/gapic-generator-python/issues/2275): logging `metadata` seems repetitive and may need to be cleaned up #} + "metadata": http_request["headers"], }, ) @@ -478,9 +480,9 @@ class _{{ name }}(_Base{{ service.name }}RestTransport._Base{{name}}, {{ async_m extra = { "serviceName": "{{ service.meta.address.proto }}", "rpcName": "{{ name }}", + "httpResponse": http_response, {# TODO(https://github.com/googleapis/gapic-generator-python/issues/2275): logging `metadata` seems repetitive and may need to be cleaned up #} "metadata": http_response["headers"], - "httpResponse": http_response, }, ) return resp 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 3e07dd39a..31f191b50 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 @@ -837,17 +837,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeIamPolicy", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeIamPolicy", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "AnalyzeIamPolicy", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -953,17 +954,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeIamPolicyLongrunning", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeIamPolicyLongrunning", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "AnalyzeIamPolicyLongrunning", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1062,17 +1064,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeMove", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeMove", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "AnalyzeMove", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1173,17 +1176,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeOrgPolicies", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeOrgPolicies", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "AnalyzeOrgPolicies", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1285,17 +1289,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeOrgPolicyGovernedAssets", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeOrgPolicyGovernedAssets", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "AnalyzeOrgPolicyGovernedAssets", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1397,17 +1402,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeOrgPolicyGovernedContainers", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.AnalyzeOrgPolicyGovernedContainers", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "AnalyzeOrgPolicyGovernedContainers", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1505,17 +1511,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.BatchGetAssetsHistory", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.BatchGetAssetsHistory", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "BatchGetAssetsHistory", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1617,17 +1624,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.BatchGetEffectiveIamPolicies", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.BatchGetEffectiveIamPolicies", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "BatchGetEffectiveIamPolicies", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1736,17 +1744,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.CreateFeed", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.CreateFeed", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "CreateFeed", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1849,17 +1858,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.CreateSavedQuery", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.CreateSavedQuery", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "CreateSavedQuery", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1953,17 +1963,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.DeleteFeed", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.DeleteFeed", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "DeleteFeed", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2033,17 +2044,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.DeleteSavedQuery", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.DeleteSavedQuery", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "DeleteSavedQuery", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2123,17 +2135,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.ExportAssets", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.ExportAssets", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "ExportAssets", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2237,17 +2250,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.GetFeed", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.GetFeed", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "GetFeed", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2347,17 +2361,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.GetSavedQuery", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.GetSavedQuery", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "GetSavedQuery", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2455,17 +2470,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.ListAssets", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.ListAssets", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "ListAssets", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2563,17 +2579,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.ListFeeds", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.ListFeeds", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "ListFeeds", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2671,17 +2688,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.ListSavedQueries", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.ListSavedQueries", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "ListSavedQueries", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2782,17 +2800,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.QueryAssets", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.QueryAssets", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "QueryAssets", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2890,17 +2909,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.SearchAllIamPolicies", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.SearchAllIamPolicies", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "SearchAllIamPolicies", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2998,17 +3018,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.SearchAllResources", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.SearchAllResources", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "SearchAllResources", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3117,17 +3138,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.UpdateFeed", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.UpdateFeed", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "UpdateFeed", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3230,17 +3252,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.UpdateSavedQuery", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.UpdateSavedQuery", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "UpdateSavedQuery", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3526,17 +3549,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.asset_v1.AssetServiceClient.GetOperation", + f"Sending request for google.cloud.asset_v1.AssetServiceClient.GetOperation", extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "GetOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3563,8 +3587,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.asset.v1.AssetService", "rpcName": "GetOperation", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp 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 09f7f29ea..0f8fe0f0f 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 @@ -341,17 +341,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.iam.credentials_v1.IAMCredentialsClient.GenerateAccessToken", + f"Sending request for google.iam.credentials_v1.IAMCredentialsClient.GenerateAccessToken", extra = { "serviceName": "google.iam.credentials.v1.IAMCredentials", "rpcName": "GenerateAccessToken", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -452,17 +453,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.iam.credentials_v1.IAMCredentialsClient.GenerateIdToken", + f"Sending request for google.iam.credentials_v1.IAMCredentialsClient.GenerateIdToken", extra = { "serviceName": "google.iam.credentials.v1.IAMCredentials", "rpcName": "GenerateIdToken", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -563,17 +565,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.iam.credentials_v1.IAMCredentialsClient.SignBlob", + f"Sending request for google.iam.credentials_v1.IAMCredentialsClient.SignBlob", extra = { "serviceName": "google.iam.credentials.v1.IAMCredentials", "rpcName": "SignBlob", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -674,17 +677,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.iam.credentials_v1.IAMCredentialsClient.SignJwt", + f"Sending request for google.iam.credentials_v1.IAMCredentialsClient.SignJwt", extra = { "serviceName": "google.iam.credentials.v1.IAMCredentials", "rpcName": "SignJwt", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) 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 8385af0da..6f79a1481 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 @@ -939,17 +939,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.CreateChannel", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.CreateChannel", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "CreateChannel", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1052,17 +1053,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.CreateChannelConnection", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.CreateChannelConnection", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "CreateChannelConnection", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1165,17 +1167,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.CreateTrigger", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.CreateTrigger", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "CreateTrigger", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1275,17 +1278,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.DeleteChannel", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.DeleteChannel", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "DeleteChannel", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1385,17 +1389,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.DeleteChannelConnection", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.DeleteChannelConnection", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "DeleteChannelConnection", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1495,17 +1500,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.DeleteTrigger", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.DeleteTrigger", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "DeleteTrigger", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1610,17 +1616,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetChannel", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetChannel", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "GetChannel", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1726,17 +1733,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetChannelConnection", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetChannelConnection", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "GetChannelConnection", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1843,17 +1851,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetGoogleChannelConfig", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetGoogleChannelConfig", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "GetGoogleChannelConfig", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1954,17 +1963,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetProvider", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetProvider", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "GetProvider", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2065,17 +2075,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetTrigger", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetTrigger", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "GetTrigger", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2176,17 +2187,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListChannelConnections", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListChannelConnections", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "ListChannelConnections", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2285,17 +2297,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListChannels", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListChannels", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "ListChannels", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2394,17 +2407,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListProviders", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListProviders", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "ListProviders", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2503,17 +2517,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListTriggers", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListTriggers", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "ListTriggers", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2618,17 +2633,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.UpdateChannel", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.UpdateChannel", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "UpdateChannel", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2737,17 +2753,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.UpdateGoogleChannelConfig", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.UpdateGoogleChannelConfig", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "UpdateGoogleChannelConfig", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2852,17 +2869,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.UpdateTrigger", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.UpdateTrigger", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "UpdateTrigger", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3106,17 +3124,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetLocation", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetLocation", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "GetLocation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3143,8 +3162,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "GetLocation", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -3215,17 +3234,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListLocations", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListLocations", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "ListLocations", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3252,8 +3272,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "ListLocations", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -3324,17 +3344,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetIamPolicy", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetIamPolicy", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "GetIamPolicy", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3361,8 +3382,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "GetIamPolicy", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -3436,17 +3457,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.SetIamPolicy", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.SetIamPolicy", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "SetIamPolicy", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3473,8 +3495,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "SetIamPolicy", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -3548,17 +3570,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.TestIamPermissions", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.TestIamPermissions", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "TestIamPermissions", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3585,8 +3608,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "TestIamPermissions", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -3657,17 +3680,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.CancelOperation", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.CancelOperation", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "CancelOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3744,17 +3768,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.DeleteOperation", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.DeleteOperation", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "DeleteOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3834,17 +3859,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetOperation", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.GetOperation", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "GetOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3871,8 +3897,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "GetOperation", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -3943,17 +3969,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListOperations", + f"Sending request for google.cloud.eventarc_v1.EventarcClient.ListOperations", extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "ListOperations", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -3980,8 +4007,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.eventarc.v1.Eventarc", "rpcName": "ListOperations", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp 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 c3ceb7bbd..2a2124b30 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 @@ -738,17 +738,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.CreateInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.CreateInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "CreateInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -848,17 +849,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.DeleteInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.DeleteInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "DeleteInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -961,17 +963,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.ExportInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.ExportInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ExportInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1074,17 +1077,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.FailoverInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.FailoverInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "FailoverInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1181,17 +1185,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1290,17 +1295,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetInstanceAuthString", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetInstanceAuthString", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetInstanceAuthString", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1405,17 +1411,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.ImportInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.ImportInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ImportInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1514,17 +1521,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListInstances", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListInstances", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ListInstances", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1629,17 +1637,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.RescheduleMaintenance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.RescheduleMaintenance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "RescheduleMaintenance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1742,17 +1751,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.UpdateInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.UpdateInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "UpdateInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1855,17 +1865,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.UpgradeInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.UpgradeInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "UpgradeInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2053,17 +2064,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetLocation", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetLocation", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetLocation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2090,8 +2102,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetLocation", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -2162,17 +2174,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListLocations", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListLocations", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ListLocations", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2199,8 +2212,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ListLocations", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -2268,17 +2281,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.CancelOperation", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.CancelOperation", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "CancelOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2355,17 +2369,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.DeleteOperation", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.DeleteOperation", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "DeleteOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2445,17 +2460,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetOperation", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetOperation", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2482,8 +2498,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetOperation", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -2554,17 +2570,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListOperations", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListOperations", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ListOperations", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2591,8 +2608,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ListOperations", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -2666,17 +2683,18 @@ def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.WaitOperation", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.WaitOperation", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "WaitOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2703,8 +2721,8 @@ def __call__(self, extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "WaitOperation", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return 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 da0081ea7..bea441bdf 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 @@ -769,17 +769,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.CreateInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.CreateInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "CreateInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -885,17 +886,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.DeleteInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.DeleteInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "DeleteInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1004,17 +1006,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.ExportInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.ExportInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ExportInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1123,17 +1126,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.FailoverInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.FailoverInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "FailoverInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1236,17 +1240,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1349,17 +1354,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetInstanceAuthString", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetInstanceAuthString", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetInstanceAuthString", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1468,17 +1474,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.ImportInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.ImportInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ImportInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1583,17 +1590,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListInstances", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListInstances", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ListInstances", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1702,17 +1710,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.RescheduleMaintenance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.RescheduleMaintenance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "RescheduleMaintenance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1821,17 +1830,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.UpdateInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.UpdateInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "UpdateInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -1940,17 +1950,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.UpgradeInstance", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.UpgradeInstance", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "UpgradeInstance", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2178,17 +2189,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetLocation", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetLocation", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetLocation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2219,8 +2231,8 @@ async def __call__(self, extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetLocation", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -2291,17 +2303,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListLocations", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListLocations", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ListLocations", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2332,8 +2345,8 @@ async def __call__(self, extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ListLocations", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -2401,17 +2414,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.CancelOperation", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.CancelOperation", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "CancelOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2492,17 +2506,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.DeleteOperation", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.DeleteOperation", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "DeleteOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2586,17 +2601,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetOperation", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.GetOperation", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2627,8 +2643,8 @@ async def __call__(self, extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "GetOperation", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -2699,17 +2715,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListOperations", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.ListOperations", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ListOperations", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2740,8 +2757,8 @@ async def __call__(self, extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "ListOperations", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp @@ -2815,17 +2832,18 @@ async def __call__(self, request_url = "{host}{uri}".format(host=self._host, uri=transcoded_request['uri']) method = transcoded_request['method'] http_request = { - "payload": type(request).to_json(request), + "payload": type(request).to_json(request), "requestMethod": method, "requestUrl": request_url, + "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.cloud.redis_v1.CloudRedisClient.WaitOperation", + f"Sending request for google.cloud.redis_v1.CloudRedisClient.WaitOperation", extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "WaitOperation", - "metadata": str(dict(metadata)), "httpRequest": http_request, + "metadata": http_request["headers"], }, ) @@ -2856,8 +2874,8 @@ async def __call__(self, extra = { "serviceName": "google.cloud.redis.v1.CloudRedis", "rpcName": "WaitOperation", - "metadata": http_response["headers"], "httpResponse": http_response, + "metadata": http_response["headers"], }, ) return resp