Skip to content

Commit feb5c03

Browse files
feat: [Many APIs] Add support for opt-in debug logging (#13345)
BEGIN_COMMIT_OVERRIDE feat: Add support for opt-in debug logging fix: Fix typing issue with gRPC metadata when key ends in -bin chore: Update gapic-generator-python to v1.21.0 END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. fix: Fix typing issue with gRPC metadata when key ends in -bin chore: Update gapic-generator-python to v1.21.0 PiperOrigin-RevId: 705285820 Source-Link: googleapis/googleapis@f9b8b91 Source-Link: googleapis/googleapis-gen@ca1e0a1 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWdzdWl0ZWFkZG9ucy8uT3dsQm90LnlhbWwiLCJoIjoiY2ExZTBhMWU0NzJkNmU2ZjVkZTg4M2E1Y2I1NDcyNGYxMTJjZTM0OCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlhbS8uT3dsQm90LnlhbWwiLCJoIjoiY2ExZTBhMWU0NzJkNmU2ZjVkZTg4M2E1Y2I1NDcyNGYxMTJjZTM0OCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlhcC8uT3dsQm90LnlhbWwiLCJoIjoiY2ExZTBhMWU0NzJkNmU2ZjVkZTg4M2E1Y2I1NDcyNGYxMTJjZTM0OCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlkcy8uT3dsQm90LnlhbWwiLCJoIjoiY2ExZTBhMWU0NzJkNmU2ZjVkZTg4M2E1Y2I1NDcyNGYxMTJjZTM0OCJ9 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWttcy1pbnZlbnRvcnkvLk93bEJvdC55YW1sIiwiaCI6ImNhMWUwYTFlNDcyZDZlNmY1ZGU4ODNhNWNiNTQ3MjRmMTEyY2UzNDgifQ== Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWttcy8uT3dsQm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ib29rcy8uT3dsQm90LnlhbWwiLCJoIjoiY2ExZTBhMWU0NzJkNmU2ZjVkZTg4M2E1Y2I1NDcyNGYxMTJjZTM0OCJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <[email protected]>
1 parent 819e8fb commit feb5c03

File tree

304 files changed

+46145
-8573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+46145
-8573
lines changed

packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.12" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.3.12" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-gsuiteaddons/google/cloud/gsuiteaddons_v1/services/g_suite_add_ons/async_client.py

Lines changed: 77 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# limitations under the License.
1515
#
1616
from collections import OrderedDict
17+
import logging as std_logging
1718
import re
1819
from typing import (
1920
Callable,
@@ -51,6 +52,15 @@
5152
from .transports.base import DEFAULT_CLIENT_INFO, GSuiteAddOnsTransport
5253
from .transports.grpc_asyncio import GSuiteAddOnsGrpcAsyncIOTransport
5354

55+
try:
56+
from google.api_core import client_logging # type: ignore
57+
58+
CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
59+
except ImportError: # pragma: NO COVER
60+
CLIENT_LOGGING_SUPPORTED = False
61+
62+
_LOGGER = std_logging.getLogger(__name__)
63+
5464

5565
class GSuiteAddOnsAsyncClient:
5666
"""A service for managing Google Workspace Add-ons deployments.
@@ -293,14 +303,36 @@ def __init__(
293303
client_info=client_info,
294304
)
295305

306+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
307+
std_logging.DEBUG
308+
): # pragma: NO COVER
309+
_LOGGER.debug(
310+
"Created client `google.cloud.gsuiteaddons_v1.GSuiteAddOnsAsyncClient`.",
311+
extra={
312+
"serviceName": "google.cloud.gsuiteaddons.v1.GSuiteAddOns",
313+
"universeDomain": getattr(
314+
self._client._transport._credentials, "universe_domain", ""
315+
),
316+
"credentialsType": f"{type(self._client._transport._credentials).__module__}.{type(self._client._transport._credentials).__qualname__}",
317+
"credentialsInfo": getattr(
318+
self.transport._credentials, "get_cred_info", lambda: None
319+
)(),
320+
}
321+
if hasattr(self._client._transport, "_credentials")
322+
else {
323+
"serviceName": "google.cloud.gsuiteaddons.v1.GSuiteAddOns",
324+
"credentialsType": None,
325+
},
326+
)
327+
296328
async def get_authorization(
297329
self,
298330
request: Optional[Union[gsuiteaddons.GetAuthorizationRequest, dict]] = None,
299331
*,
300332
name: Optional[str] = None,
301333
retry: OptionalRetry = gapic_v1.method.DEFAULT,
302334
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
303-
metadata: Sequence[Tuple[str, str]] = (),
335+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
304336
) -> gsuiteaddons.Authorization:
305337
r"""Gets the authorization information for deployments in
306338
a given project.
@@ -348,8 +380,10 @@ async def sample_get_authorization():
348380
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
349381
should be retried.
350382
timeout (float): The timeout for this request.
351-
metadata (Sequence[Tuple[str, str]]): Strings which should be
352-
sent along with the request as metadata.
383+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
384+
sent along with the request as metadata. Normally, each value must be of type `str`,
385+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
386+
be of type `bytes`.
353387
354388
Returns:
355389
google.cloud.gsuiteaddons_v1.types.Authorization:
@@ -412,7 +446,7 @@ async def create_deployment(
412446
deployment_id: Optional[str] = None,
413447
retry: OptionalRetry = gapic_v1.method.DEFAULT,
414448
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
415-
metadata: Sequence[Tuple[str, str]] = (),
449+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
416450
) -> gsuiteaddons.Deployment:
417451
r"""Creates a deployment with the specified name and
418452
configuration.
@@ -475,8 +509,10 @@ async def sample_create_deployment():
475509
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
476510
should be retried.
477511
timeout (float): The timeout for this request.
478-
metadata (Sequence[Tuple[str, str]]): Strings which should be
479-
sent along with the request as metadata.
512+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
513+
sent along with the request as metadata. Normally, each value must be of type `str`,
514+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
515+
be of type `bytes`.
480516
481517
Returns:
482518
google.cloud.gsuiteaddons_v1.types.Deployment:
@@ -539,7 +575,7 @@ async def replace_deployment(
539575
deployment: Optional[gsuiteaddons.Deployment] = None,
540576
retry: OptionalRetry = gapic_v1.method.DEFAULT,
541577
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
542-
metadata: Sequence[Tuple[str, str]] = (),
578+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
543579
) -> gsuiteaddons.Deployment:
544580
r"""Creates or replaces a deployment with the specified
545581
name.
@@ -583,8 +619,10 @@ async def sample_replace_deployment():
583619
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
584620
should be retried.
585621
timeout (float): The timeout for this request.
586-
metadata (Sequence[Tuple[str, str]]): Strings which should be
587-
sent along with the request as metadata.
622+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
623+
sent along with the request as metadata. Normally, each value must be of type `str`,
624+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
625+
be of type `bytes`.
588626
589627
Returns:
590628
google.cloud.gsuiteaddons_v1.types.Deployment:
@@ -645,7 +683,7 @@ async def get_deployment(
645683
name: Optional[str] = None,
646684
retry: OptionalRetry = gapic_v1.method.DEFAULT,
647685
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
648-
metadata: Sequence[Tuple[str, str]] = (),
686+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
649687
) -> gsuiteaddons.Deployment:
650688
r"""Gets the deployment with the specified name.
651689
@@ -691,8 +729,10 @@ async def sample_get_deployment():
691729
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
692730
should be retried.
693731
timeout (float): The timeout for this request.
694-
metadata (Sequence[Tuple[str, str]]): Strings which should be
695-
sent along with the request as metadata.
732+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
733+
sent along with the request as metadata. Normally, each value must be of type `str`,
734+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
735+
be of type `bytes`.
696736
697737
Returns:
698738
google.cloud.gsuiteaddons_v1.types.Deployment:
@@ -751,7 +791,7 @@ async def list_deployments(
751791
parent: Optional[str] = None,
752792
retry: OptionalRetry = gapic_v1.method.DEFAULT,
753793
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
754-
metadata: Sequence[Tuple[str, str]] = (),
794+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
755795
) -> pagers.ListDeploymentsAsyncPager:
756796
r"""Lists all deployments in a particular project.
757797
@@ -798,8 +838,10 @@ async def sample_list_deployments():
798838
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
799839
should be retried.
800840
timeout (float): The timeout for this request.
801-
metadata (Sequence[Tuple[str, str]]): Strings which should be
802-
sent along with the request as metadata.
841+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
842+
sent along with the request as metadata. Normally, each value must be of type `str`,
843+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
844+
be of type `bytes`.
803845
804846
Returns:
805847
google.cloud.gsuiteaddons_v1.services.g_suite_add_ons.pagers.ListDeploymentsAsyncPager:
@@ -874,7 +916,7 @@ async def delete_deployment(
874916
name: Optional[str] = None,
875917
retry: OptionalRetry = gapic_v1.method.DEFAULT,
876918
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
877-
metadata: Sequence[Tuple[str, str]] = (),
919+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
878920
) -> None:
879921
r"""Deletes the deployment with the given name.
880922
@@ -918,8 +960,10 @@ async def sample_delete_deployment():
918960
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
919961
should be retried.
920962
timeout (float): The timeout for this request.
921-
metadata (Sequence[Tuple[str, str]]): Strings which should be
922-
sent along with the request as metadata.
963+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
964+
sent along with the request as metadata. Normally, each value must be of type `str`,
965+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
966+
be of type `bytes`.
923967
"""
924968
# Create or coerce a protobuf request object.
925969
# - Quick check: If we got a request object, we should *not* have
@@ -971,7 +1015,7 @@ async def install_deployment(
9711015
name: Optional[str] = None,
9721016
retry: OptionalRetry = gapic_v1.method.DEFAULT,
9731017
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
974-
metadata: Sequence[Tuple[str, str]] = (),
1018+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
9751019
) -> None:
9761020
r"""Installs a deployment in developer mode.
9771021
See:
@@ -1018,8 +1062,10 @@ async def sample_install_deployment():
10181062
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
10191063
should be retried.
10201064
timeout (float): The timeout for this request.
1021-
metadata (Sequence[Tuple[str, str]]): Strings which should be
1022-
sent along with the request as metadata.
1065+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1066+
sent along with the request as metadata. Normally, each value must be of type `str`,
1067+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
1068+
be of type `bytes`.
10231069
"""
10241070
# Create or coerce a protobuf request object.
10251071
# - Quick check: If we got a request object, we should *not* have
@@ -1071,7 +1117,7 @@ async def uninstall_deployment(
10711117
name: Optional[str] = None,
10721118
retry: OptionalRetry = gapic_v1.method.DEFAULT,
10731119
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1074-
metadata: Sequence[Tuple[str, str]] = (),
1120+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
10751121
) -> None:
10761122
r"""Uninstalls a developer mode deployment.
10771123
See:
@@ -1118,8 +1164,10 @@ async def sample_uninstall_deployment():
11181164
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
11191165
should be retried.
11201166
timeout (float): The timeout for this request.
1121-
metadata (Sequence[Tuple[str, str]]): Strings which should be
1122-
sent along with the request as metadata.
1167+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1168+
sent along with the request as metadata. Normally, each value must be of type `str`,
1169+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
1170+
be of type `bytes`.
11231171
"""
11241172
# Create or coerce a protobuf request object.
11251173
# - Quick check: If we got a request object, we should *not* have
@@ -1171,7 +1219,7 @@ async def get_install_status(
11711219
name: Optional[str] = None,
11721220
retry: OptionalRetry = gapic_v1.method.DEFAULT,
11731221
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1174-
metadata: Sequence[Tuple[str, str]] = (),
1222+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
11751223
) -> gsuiteaddons.InstallStatus:
11761224
r"""Fetches the install status of a developer mode
11771225
deployment.
@@ -1218,8 +1266,10 @@ async def sample_get_install_status():
12181266
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
12191267
should be retried.
12201268
timeout (float): The timeout for this request.
1221-
metadata (Sequence[Tuple[str, str]]): Strings which should be
1222-
sent along with the request as metadata.
1269+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1270+
sent along with the request as metadata. Normally, each value must be of type `str`,
1271+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
1272+
be of type `bytes`.
12231273
12241274
Returns:
12251275
google.cloud.gsuiteaddons_v1.types.InstallStatus:

0 commit comments

Comments
 (0)