Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
chore: upgrade gapic-generator-python to 0.46.3 (#80)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 373649163

Source-Link: googleapis/googleapis@7e1b14e

Source-Link: googleapis/googleapis-gen@0a3c7d2
  • Loading branch information
gcf-owl-bot[bot] committed May 14, 2021
1 parent d676409 commit 4fc4767
Show file tree
Hide file tree
Showing 34 changed files with 1,113 additions and 641 deletions.
16 changes: 8 additions & 8 deletions google/cloud/webrisk/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,13 +14,13 @@
# limitations under the License.
#

from google.cloud.webrisk_v1.services.web_risk_service.async_client import (
WebRiskServiceAsyncClient,
)
from google.cloud.webrisk_v1.services.web_risk_service.client import (
WebRiskServiceClient,
)
from google.cloud.webrisk_v1.types.webrisk import CompressionType
from google.cloud.webrisk_v1.services.web_risk_service.async_client import (
WebRiskServiceAsyncClient,
)

from google.cloud.webrisk_v1.types.webrisk import ComputeThreatListDiffRequest
from google.cloud.webrisk_v1.types.webrisk import ComputeThreatListDiffResponse
from google.cloud.webrisk_v1.types.webrisk import CreateSubmissionRequest
Expand All @@ -35,10 +34,12 @@
from google.cloud.webrisk_v1.types.webrisk import Submission
from google.cloud.webrisk_v1.types.webrisk import ThreatEntryAdditions
from google.cloud.webrisk_v1.types.webrisk import ThreatEntryRemovals
from google.cloud.webrisk_v1.types.webrisk import CompressionType
from google.cloud.webrisk_v1.types.webrisk import ThreatType

__all__ = (
"CompressionType",
"WebRiskServiceClient",
"WebRiskServiceAsyncClient",
"ComputeThreatListDiffRequest",
"ComputeThreatListDiffResponse",
"CreateSubmissionRequest",
Expand All @@ -52,7 +53,6 @@
"Submission",
"ThreatEntryAdditions",
"ThreatEntryRemovals",
"CompressionType",
"ThreatType",
"WebRiskServiceAsyncClient",
"WebRiskServiceClient",
)
7 changes: 4 additions & 3 deletions google/cloud/webrisk_v1/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,7 +15,8 @@
#

from .services.web_risk_service import WebRiskServiceClient
from .types.webrisk import CompressionType
from .services.web_risk_service import WebRiskServiceAsyncClient

from .types.webrisk import ComputeThreatListDiffRequest
from .types.webrisk import ComputeThreatListDiffResponse
from .types.webrisk import CreateSubmissionRequest
Expand All @@ -30,10 +30,11 @@
from .types.webrisk import Submission
from .types.webrisk import ThreatEntryAdditions
from .types.webrisk import ThreatEntryRemovals
from .types.webrisk import CompressionType
from .types.webrisk import ThreatType


__all__ = (
"WebRiskServiceAsyncClient",
"CompressionType",
"ComputeThreatListDiffRequest",
"ComputeThreatListDiffResponse",
Expand Down
63 changes: 63 additions & 0 deletions google/cloud/webrisk_v1/gapic_metadata.json
@@ -0,0 +1,63 @@
{
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
"language": "python",
"libraryPackage": "google.cloud.webrisk_v1",
"protoPackage": "google.cloud.webrisk.v1",
"schema": "1.0",
"services": {
"WebRiskService": {
"clients": {
"grpc": {
"libraryClient": "WebRiskServiceClient",
"rpcs": {
"ComputeThreatListDiff": {
"methods": [
"compute_threat_list_diff"
]
},
"CreateSubmission": {
"methods": [
"create_submission"
]
},
"SearchHashes": {
"methods": [
"search_hashes"
]
},
"SearchUris": {
"methods": [
"search_uris"
]
}
}
},
"grpc-async": {
"libraryClient": "WebRiskServiceAsyncClient",
"rpcs": {
"ComputeThreatListDiff": {
"methods": [
"compute_threat_list_diff"
]
},
"CreateSubmission": {
"methods": [
"create_submission"
]
},
"SearchHashes": {
"methods": [
"search_hashes"
]
},
"SearchUris": {
"methods": [
"search_uris"
]
}
}
}
}
}
}
}
1 change: 0 additions & 1 deletion google/cloud/webrisk_v1/services/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 0 additions & 2 deletions google/cloud/webrisk_v1/services/web_risk_service/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

from .client import WebRiskServiceClient
from .async_client import WebRiskServiceAsyncClient

Expand Down
44 changes: 15 additions & 29 deletions google/cloud/webrisk_v1/services/web_risk_service/async_client.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,23 +13,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

from collections import OrderedDict
import functools
import re
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

from google.cloud.webrisk_v1.types import webrisk
from google.protobuf import timestamp_pb2 as timestamp # type: ignore

from google.protobuf import timestamp_pb2 # type: ignore
from .transports.base import WebRiskServiceTransport, DEFAULT_CLIENT_INFO
from .transports.grpc_asyncio import WebRiskServiceGrpcAsyncIOTransport
from .client import WebRiskServiceClient
Expand All @@ -52,32 +49,29 @@ class WebRiskServiceAsyncClient:
parse_common_billing_account_path = staticmethod(
WebRiskServiceClient.parse_common_billing_account_path
)

common_folder_path = staticmethod(WebRiskServiceClient.common_folder_path)
parse_common_folder_path = staticmethod(
WebRiskServiceClient.parse_common_folder_path
)

common_organization_path = staticmethod(
WebRiskServiceClient.common_organization_path
)
parse_common_organization_path = staticmethod(
WebRiskServiceClient.parse_common_organization_path
)

common_project_path = staticmethod(WebRiskServiceClient.common_project_path)
parse_common_project_path = staticmethod(
WebRiskServiceClient.parse_common_project_path
)

common_location_path = staticmethod(WebRiskServiceClient.common_location_path)
parse_common_location_path = staticmethod(
WebRiskServiceClient.parse_common_location_path
)

@classmethod
def from_service_account_info(cls, info: dict, *args, **kwargs):
"""Creates an instance of this client using the provided credentials info.
"""Creates an instance of this client using the provided credentials
info.
Args:
info (dict): The service account private key info.
Expand All @@ -92,7 +86,7 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.
file.
Args:
filename (str): The path to the service account private key json
Expand All @@ -109,7 +103,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):

@property
def transport(self) -> WebRiskServiceTransport:
"""Return the transport used by the client instance.
"""Returns the transport used by the client instance.
Returns:
WebRiskServiceTransport: The transport used by the client instance.
Expand All @@ -123,12 +117,12 @@ def transport(self) -> WebRiskServiceTransport:
def __init__(
self,
*,
credentials: credentials.Credentials = None,
credentials: ga_credentials.Credentials = None,
transport: Union[str, WebRiskServiceTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the web risk service client.
"""Instantiates the web risk service client.
Args:
credentials (Optional[google.auth.credentials.Credentials]): The
Expand Down Expand Up @@ -160,7 +154,6 @@ def __init__(
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
creation failed for any reason.
"""

self._client = WebRiskServiceClient(
credentials=credentials,
transport=transport,
Expand Down Expand Up @@ -220,7 +213,6 @@ async def compute_threat_list_diff(
This corresponds to the ``constraints`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -245,7 +237,6 @@ async def compute_threat_list_diff(

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if threat_type is not None:
request.threat_type = threat_type
if version_token is not None:
Expand All @@ -262,7 +253,8 @@ async def compute_threat_list_diff(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=600.0,
),
Expand Down Expand Up @@ -312,7 +304,6 @@ async def search_uris(
This corresponds to the ``threat_types`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -337,10 +328,8 @@ async def search_uris(

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if uri is not None:
request.uri = uri

if threat_types:
request.threat_types.extend(threat_types)

Expand All @@ -353,7 +342,8 @@ async def search_uris(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=600.0,
),
Expand Down Expand Up @@ -405,7 +395,6 @@ async def search_hashes(
This corresponds to the ``threat_types`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -430,10 +419,8 @@ async def search_hashes(

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if hash_prefix is not None:
request.hash_prefix = hash_prefix

if threat_types:
request.threat_types.extend(threat_types)

Expand All @@ -446,7 +433,8 @@ async def search_hashes(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
core_exceptions.DeadlineExceeded,
core_exceptions.ServiceUnavailable,
),
deadline=600.0,
),
Expand Down Expand Up @@ -499,7 +487,6 @@ async def create_submission(
This corresponds to the ``submission`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -526,7 +513,6 @@ async def create_submission(

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if parent is not None:
request.parent = parent
if submission is not None:
Expand Down

0 comments on commit 4fc4767

Please sign in to comment.