Skip to content

Commit

Permalink
feat: [Many APIs] Add support for opt-in debug logging (#13345)
Browse files Browse the repository at this point in the history
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:
eyJwIjoicGFja2FnZXMvZ29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y-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW5vdGVib29rcy8uT3dsQm90LnlhbWwiLCJoIjoiY2ExZTBhMWU0NzJkNmU2ZjVkZTg4M2E1Y2I1NDcyNGYxMTJjZTM0OCJ9

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: ohmayr <omairnaveed@ymail.com>
  • Loading branch information
3 people authored Dec 12, 2024
1 parent 819e8fb commit feb5c03
Show file tree
Hide file tree
Showing 304 changed files with 46,145 additions and 8,573 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.3.12" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.3.12" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.
#
from collections import OrderedDict
import logging as std_logging
import re
from typing import (
Callable,
Expand Down Expand Up @@ -51,6 +52,15 @@
from .transports.base import DEFAULT_CLIENT_INFO, GSuiteAddOnsTransport
from .transports.grpc_asyncio import GSuiteAddOnsGrpcAsyncIOTransport

try:
from google.api_core import client_logging # type: ignore

CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
except ImportError: # pragma: NO COVER
CLIENT_LOGGING_SUPPORTED = False

_LOGGER = std_logging.getLogger(__name__)


class GSuiteAddOnsAsyncClient:
"""A service for managing Google Workspace Add-ons deployments.
Expand Down Expand Up @@ -293,14 +303,36 @@ def __init__(
client_info=client_info,
)

if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
std_logging.DEBUG
): # pragma: NO COVER
_LOGGER.debug(
"Created client `google.cloud.gsuiteaddons_v1.GSuiteAddOnsAsyncClient`.",
extra={
"serviceName": "google.cloud.gsuiteaddons.v1.GSuiteAddOns",
"universeDomain": getattr(
self._client._transport._credentials, "universe_domain", ""
),
"credentialsType": f"{type(self._client._transport._credentials).__module__}.{type(self._client._transport._credentials).__qualname__}",
"credentialsInfo": getattr(
self.transport._credentials, "get_cred_info", lambda: None
)(),
}
if hasattr(self._client._transport, "_credentials")
else {
"serviceName": "google.cloud.gsuiteaddons.v1.GSuiteAddOns",
"credentialsType": None,
},
)

async def get_authorization(
self,
request: Optional[Union[gsuiteaddons.GetAuthorizationRequest, dict]] = None,
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> gsuiteaddons.Authorization:
r"""Gets the authorization information for deployments in
a given project.
Expand Down Expand Up @@ -348,8 +380,10 @@ async def sample_get_authorization():
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
google.cloud.gsuiteaddons_v1.types.Authorization:
Expand Down Expand Up @@ -412,7 +446,7 @@ async def create_deployment(
deployment_id: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> gsuiteaddons.Deployment:
r"""Creates a deployment with the specified name and
configuration.
Expand Down Expand Up @@ -475,8 +509,10 @@ async def sample_create_deployment():
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
google.cloud.gsuiteaddons_v1.types.Deployment:
Expand Down Expand Up @@ -539,7 +575,7 @@ async def replace_deployment(
deployment: Optional[gsuiteaddons.Deployment] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> gsuiteaddons.Deployment:
r"""Creates or replaces a deployment with the specified
name.
Expand Down Expand Up @@ -583,8 +619,10 @@ async def sample_replace_deployment():
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
google.cloud.gsuiteaddons_v1.types.Deployment:
Expand Down Expand Up @@ -645,7 +683,7 @@ async def get_deployment(
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> gsuiteaddons.Deployment:
r"""Gets the deployment with the specified name.
Expand Down Expand Up @@ -691,8 +729,10 @@ async def sample_get_deployment():
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
google.cloud.gsuiteaddons_v1.types.Deployment:
Expand Down Expand Up @@ -751,7 +791,7 @@ async def list_deployments(
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> pagers.ListDeploymentsAsyncPager:
r"""Lists all deployments in a particular project.
Expand Down Expand Up @@ -798,8 +838,10 @@ async def sample_list_deployments():
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
google.cloud.gsuiteaddons_v1.services.g_suite_add_ons.pagers.ListDeploymentsAsyncPager:
Expand Down Expand Up @@ -874,7 +916,7 @@ async def delete_deployment(
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> None:
r"""Deletes the deployment with the given name.
Expand Down Expand Up @@ -918,8 +960,10 @@ async def sample_delete_deployment():
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
Expand Down Expand Up @@ -971,7 +1015,7 @@ async def install_deployment(
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> None:
r"""Installs a deployment in developer mode.
See:
Expand Down Expand Up @@ -1018,8 +1062,10 @@ async def sample_install_deployment():
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
Expand Down Expand Up @@ -1071,7 +1117,7 @@ async def uninstall_deployment(
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> None:
r"""Uninstalls a developer mode deployment.
See:
Expand Down Expand Up @@ -1118,8 +1164,10 @@ async def sample_uninstall_deployment():
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
Expand Down Expand Up @@ -1171,7 +1219,7 @@ async def get_install_status(
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> gsuiteaddons.InstallStatus:
r"""Fetches the install status of a developer mode
deployment.
Expand Down Expand Up @@ -1218,8 +1266,10 @@ async def sample_get_install_status():
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
google.cloud.gsuiteaddons_v1.types.InstallStatus:
Expand Down
Loading

0 comments on commit feb5c03

Please sign in to comment.