Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.53.4 (#281)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

docs: list oneofs in docstring
fix(deps): require google-api-core >= 1.28.0
fix(deps): drop packaging dependency
fix: fix extras_require typo in setup.py

committer: busunkim96@
PiperOrigin-RevId: 406468269

Source-Link: googleapis/googleapis@83d81b0

Source-Link: googleapis/googleapis-gen@2ff001f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
  • Loading branch information
gcf-owl-bot[bot] authored Nov 1, 2021
1 parent f842bb0 commit 5f70bef
Show file tree
Hide file tree
Showing 9 changed files with 485 additions and 257 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.cloud.dlp_v2.services.dlp_service import pagers
from google.cloud.dlp_v2.types import dlp
from google.protobuf import field_mask_pb2 # type: ignore
Expand Down Expand Up @@ -447,7 +449,7 @@ def inspect_content(
self,
request: Union[dlp.InspectContentRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.InspectContentResponse:
Expand Down Expand Up @@ -504,7 +506,7 @@ def redact_image(
self,
request: Union[dlp.RedactImageRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.RedactImageResponse:
Expand Down Expand Up @@ -562,7 +564,7 @@ def deidentify_content(
self,
request: Union[dlp.DeidentifyContentRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.DeidentifyContentResponse:
Expand Down Expand Up @@ -621,7 +623,7 @@ def reidentify_content(
self,
request: Union[dlp.ReidentifyContentRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.ReidentifyContentResponse:
Expand Down Expand Up @@ -671,7 +673,7 @@ def list_info_types(
request: Union[dlp.ListInfoTypesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.ListInfoTypesResponse:
Expand Down Expand Up @@ -744,7 +746,7 @@ def create_inspect_template(
*,
parent: str = None,
inspect_template: dlp.InspectTemplate = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.InspectTemplate:
Expand Down Expand Up @@ -856,7 +858,7 @@ def update_inspect_template(
name: str = None,
inspect_template: dlp.InspectTemplate = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.InspectTemplate:
Expand Down Expand Up @@ -952,7 +954,7 @@ def get_inspect_template(
request: Union[dlp.GetInspectTemplateRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.InspectTemplate:
Expand Down Expand Up @@ -1032,7 +1034,7 @@ def list_inspect_templates(
request: Union[dlp.ListInspectTemplatesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListInspectTemplatesPager:
Expand Down Expand Up @@ -1136,7 +1138,7 @@ def delete_inspect_template(
request: Union[dlp.DeleteInspectTemplateRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -1205,7 +1207,7 @@ def create_deidentify_template(
*,
parent: str = None,
deidentify_template: dlp.DeidentifyTemplate = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.DeidentifyTemplate:
Expand Down Expand Up @@ -1318,7 +1320,7 @@ def update_deidentify_template(
name: str = None,
deidentify_template: dlp.DeidentifyTemplate = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.DeidentifyTemplate:
Expand Down Expand Up @@ -1414,7 +1416,7 @@ def get_deidentify_template(
request: Union[dlp.GetDeidentifyTemplateRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.DeidentifyTemplate:
Expand Down Expand Up @@ -1492,7 +1494,7 @@ def list_deidentify_templates(
request: Union[dlp.ListDeidentifyTemplatesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListDeidentifyTemplatesPager:
Expand Down Expand Up @@ -1598,7 +1600,7 @@ def delete_deidentify_template(
request: Union[dlp.DeleteDeidentifyTemplateRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -1669,7 +1671,7 @@ def create_job_trigger(
*,
parent: str = None,
job_trigger: dlp.JobTrigger = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.JobTrigger:
Expand Down Expand Up @@ -1772,7 +1774,7 @@ def update_job_trigger(
name: str = None,
job_trigger: dlp.JobTrigger = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.JobTrigger:
Expand Down Expand Up @@ -1864,7 +1866,7 @@ def hybrid_inspect_job_trigger(
request: Union[dlp.HybridInspectJobTriggerRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.HybridInspectResponse:
Expand Down Expand Up @@ -1945,7 +1947,7 @@ def get_job_trigger(
request: Union[dlp.GetJobTriggerRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.JobTrigger:
Expand Down Expand Up @@ -2020,7 +2022,7 @@ def list_job_triggers(
request: Union[dlp.ListJobTriggersRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListJobTriggersPager:
Expand Down Expand Up @@ -2117,7 +2119,7 @@ def delete_job_trigger(
request: Union[dlp.DeleteJobTriggerRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -2183,7 +2185,7 @@ def activate_job_trigger(
self,
request: Union[dlp.ActivateJobTriggerRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.DlpJob:
Expand Down Expand Up @@ -2238,7 +2240,7 @@ def create_dlp_job(
parent: str = None,
inspect_job: dlp.InspectJobConfig = None,
risk_job: dlp.RiskAnalysisJobConfig = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.DlpJob:
Expand Down Expand Up @@ -2354,7 +2356,7 @@ def list_dlp_jobs(
request: Union[dlp.ListDlpJobsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListDlpJobsPager:
Expand Down Expand Up @@ -2455,7 +2457,7 @@ def get_dlp_job(
request: Union[dlp.GetDlpJobRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.DlpJob:
Expand Down Expand Up @@ -2529,7 +2531,7 @@ def delete_dlp_job(
request: Union[dlp.DeleteDlpJobRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -2597,7 +2599,7 @@ def cancel_dlp_job(
self,
request: Union[dlp.CancelDlpJobRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -2647,7 +2649,7 @@ def create_stored_info_type(
*,
parent: str = None,
config: dlp.StoredInfoTypeConfig = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.StoredInfoType:
Expand Down Expand Up @@ -2755,7 +2757,7 @@ def update_stored_info_type(
name: str = None,
config: dlp.StoredInfoTypeConfig = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.StoredInfoType:
Expand Down Expand Up @@ -2853,7 +2855,7 @@ def get_stored_info_type(
request: Union[dlp.GetStoredInfoTypeRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.StoredInfoType:
Expand Down Expand Up @@ -2929,7 +2931,7 @@ def list_stored_info_types(
request: Union[dlp.ListStoredInfoTypesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListStoredInfoTypesPager:
Expand Down Expand Up @@ -3033,7 +3035,7 @@ def delete_stored_info_type(
request: Union[dlp.DeleteStoredInfoTypeRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -3101,7 +3103,7 @@ def hybrid_inspect_dlp_job(
request: Union[dlp.HybridInspectDlpJobRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> dlp.HybridInspectResponse:
Expand Down Expand Up @@ -3178,7 +3180,7 @@ def finish_dlp_job(
self,
request: Union[dlp.FinishDlpJobRequest, dict] = None,
*,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import packaging.version
import pkg_resources

import google.auth # type: ignore
Expand All @@ -36,15 +35,6 @@
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()

try:
# google.auth.__version__ was added in 1.26.0
_GOOGLE_AUTH_VERSION = google.auth.__version__
except AttributeError:
try: # try pkg_resources if it is available
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
except pkg_resources.DistributionNotFound: # pragma: NO COVER
_GOOGLE_AUTH_VERSION = None


class DlpServiceTransport(abc.ABC):
"""Abstract transport class for DlpService."""
Expand Down Expand Up @@ -94,7 +84,7 @@ def __init__(
host += ":443"
self._host = host

scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
Expand Down Expand Up @@ -127,29 +117,6 @@ def __init__(
# Save the credentials.
self._credentials = credentials

# TODO(busunkim): This method is in the base transport
# to avoid duplicating code across the transport classes. These functions
# should be deleted once the minimum required versions of google-auth is increased.

# TODO: Remove this function once google-auth >= 1.25.0 is required
@classmethod
def _get_scopes_kwargs(
cls, host: str, scopes: Optional[Sequence[str]]
) -> Dict[str, Optional[Sequence[str]]]:
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""

scopes_kwargs = {}

if _GOOGLE_AUTH_VERSION and (
packaging.version.parse(_GOOGLE_AUTH_VERSION)
>= packaging.version.parse("1.25.0")
):
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
else:
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}

return scopes_kwargs

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from google.api_core import grpc_helpers_async # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
import packaging.version

import grpc # type: ignore
from grpc.experimental import aio # type: ignore
Expand Down
Loading

0 comments on commit 5f70bef

Please sign in to comment.