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

Commit 64b1ef3

Browse files
chore: Update gapic-generator-python to v1.6.1 (#240)
* chore: update to gapic-generator-python 1.5.0 feat: add support for `google.cloud.<api>.__version__` PiperOrigin-RevId: 484665853 Source-Link: googleapis/googleapis@8eb249a Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8aa327b5f478865fc3fd91e3c2768e54e26ad44 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update version in gapic_version.py * add .release-please-manifest.json with correct version * add owlbot.py to exclude generated gapic_version.py * set manifest to true in .github/release-please.yml * add release-please-config.json * chore: Update to gapic-generator-python 1.6.0 feat(python): Add typing to proto.Message based class attributes feat(python): Snippetgen handling of repeated enum field PiperOrigin-RevId: 487326846 Source-Link: googleapis/googleapis@da380c7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/61ef5762ee6731a0cbbfea22fd0eecee51ab1c8e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: new APIs added to reflect updates to the filestore service - Add ENTERPRISE Tier - Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot - Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare - Add ConnectMode to NetworkConfig (for Private Service Access support) - New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING) - Add SuspensionReason (for KMS related suspension) - Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled PiperOrigin-RevId: 487492758 Source-Link: googleapis/googleapis@5be5981 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab0e217f560cc2c1afc11441c2eab6b6950efd2b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update path to snippet metadata json * chore: Update gapic-generator-python to v1.6.1 PiperOrigin-RevId: 488036204 Source-Link: googleapis/googleapis@08f275f Source-Link: https://github.com/googleapis/googleapis-gen/commit/555c0945e60649e38739ae64bc45719cdf72178f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 46cf16d commit 64b1ef3

38 files changed

+467
-280
lines changed

‎.github/release-please.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
releaseType: python
22
handleGHRelease: true
3+
manifest: true
34
# NOTE: this section is generated by synthtool.languages.python
45
# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py
56
branches:

‎.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.8.4"
3+
}

‎docs/webrisk_v1/types.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ Types for Google Cloud Webrisk v1 API
33

44
.. automodule:: google.cloud.webrisk_v1.types
55
:members:
6-
:undoc-members:
76
:show-inheritance:

‎docs/webrisk_v1beta1/types.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ Types for Google Cloud Webrisk v1beta1 API
33

44
.. automodule:: google.cloud.webrisk_v1beta1.types
55
:members:
6-
:undoc-members:
76
:show-inheritance:

‎google/cloud/webrisk/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from google.cloud.webrisk import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from google.cloud.webrisk_v1.services.web_risk_service.async_client import (
1822
WebRiskServiceAsyncClient,

‎google/cloud/webrisk/gapic_version.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "1.8.4" # {x-release-please-version}

‎google/cloud/webrisk_v1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from google.cloud.webrisk import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from .services.web_risk_service import WebRiskServiceAsyncClient, WebRiskServiceClient
1822
from .types.webrisk import (

‎google/cloud/webrisk_v1/services/web_risk_service/async_client.py

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@
1616
from collections import OrderedDict
1717
import functools
1818
import re
19-
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
19+
from typing import (
20+
Dict,
21+
Mapping,
22+
MutableMapping,
23+
MutableSequence,
24+
Optional,
25+
Sequence,
26+
Tuple,
27+
Type,
28+
Union,
29+
)
2030

2131
from google.api_core import exceptions as core_exceptions
2232
from google.api_core import gapic_v1
@@ -160,9 +170,9 @@ def transport(self) -> WebRiskServiceTransport:
160170
def __init__(
161171
self,
162172
*,
163-
credentials: ga_credentials.Credentials = None,
173+
credentials: Optional[ga_credentials.Credentials] = None,
164174
transport: Union[str, WebRiskServiceTransport] = "grpc_asyncio",
165-
client_options: ClientOptions = None,
175+
client_options: Optional[ClientOptions] = None,
166176
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
167177
) -> None:
168178
"""Instantiates the web risk service client.
@@ -206,13 +216,13 @@ def __init__(
206216

207217
async def compute_threat_list_diff(
208218
self,
209-
request: Union[webrisk.ComputeThreatListDiffRequest, dict] = None,
219+
request: Optional[Union[webrisk.ComputeThreatListDiffRequest, dict]] = None,
210220
*,
211-
threat_type: webrisk.ThreatType = None,
212-
version_token: bytes = None,
213-
constraints: webrisk.ComputeThreatListDiffRequest.Constraints = None,
221+
threat_type: Optional[webrisk.ThreatType] = None,
222+
version_token: Optional[bytes] = None,
223+
constraints: Optional[webrisk.ComputeThreatListDiffRequest.Constraints] = None,
214224
retry: OptionalRetry = gapic_v1.method.DEFAULT,
215-
timeout: float = None,
225+
timeout: Optional[float] = None,
216226
metadata: Sequence[Tuple[str, str]] = (),
217227
) -> webrisk.ComputeThreatListDiffResponse:
218228
r"""Gets the most recent threat list diffs. These diffs
@@ -251,7 +261,7 @@ async def sample_compute_threat_list_diff():
251261
print(response)
252262
253263
Args:
254-
request (Union[google.cloud.webrisk_v1.types.ComputeThreatListDiffRequest, dict]):
264+
request (Optional[Union[google.cloud.webrisk_v1.types.ComputeThreatListDiffRequest, dict]]):
255265
The request object. Describes an API diff request.
256266
threat_type (:class:`google.cloud.webrisk_v1.types.ThreatType`):
257267
Required. The threat list to update.
@@ -346,12 +356,12 @@ async def sample_compute_threat_list_diff():
346356

347357
async def search_uris(
348358
self,
349-
request: Union[webrisk.SearchUrisRequest, dict] = None,
359+
request: Optional[Union[webrisk.SearchUrisRequest, dict]] = None,
350360
*,
351-
uri: str = None,
352-
threat_types: Sequence[webrisk.ThreatType] = None,
361+
uri: Optional[str] = None,
362+
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
353363
retry: OptionalRetry = gapic_v1.method.DEFAULT,
354-
timeout: float = None,
364+
timeout: Optional[float] = None,
355365
metadata: Sequence[Tuple[str, str]] = (),
356366
) -> webrisk.SearchUrisResponse:
357367
r"""This method is used to check whether a URI is on a
@@ -379,7 +389,7 @@ async def sample_search_uris():
379389
# Initialize request argument(s)
380390
request = webrisk_v1.SearchUrisRequest(
381391
uri="uri_value",
382-
threat_types="SOCIAL_ENGINEERING_EXTENDED_COVERAGE",
392+
threat_types=['SOCIAL_ENGINEERING_EXTENDED_COVERAGE'],
383393
)
384394
385395
# Make the request
@@ -389,7 +399,7 @@ async def sample_search_uris():
389399
print(response)
390400
391401
Args:
392-
request (Union[google.cloud.webrisk_v1.types.SearchUrisRequest, dict]):
402+
request (Optional[Union[google.cloud.webrisk_v1.types.SearchUrisRequest, dict]]):
393403
The request object. Request to check URI entries against
394404
threatLists.
395405
uri (:class:`str`):
@@ -399,7 +409,7 @@ async def sample_search_uris():
399409
This corresponds to the ``uri`` field
400410
on the ``request`` instance; if ``request`` is provided, this
401411
should not be set.
402-
threat_types (:class:`Sequence[google.cloud.webrisk_v1.types.ThreatType]`):
412+
threat_types (:class:`MutableSequence[google.cloud.webrisk_v1.types.ThreatType]`):
403413
Required. The ThreatLists to search
404414
in. Multiple ThreatLists may be
405415
specified.
@@ -467,12 +477,12 @@ async def sample_search_uris():
467477

468478
async def search_hashes(
469479
self,
470-
request: Union[webrisk.SearchHashesRequest, dict] = None,
480+
request: Optional[Union[webrisk.SearchHashesRequest, dict]] = None,
471481
*,
472-
hash_prefix: bytes = None,
473-
threat_types: Sequence[webrisk.ThreatType] = None,
482+
hash_prefix: Optional[bytes] = None,
483+
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
474484
retry: OptionalRetry = gapic_v1.method.DEFAULT,
475-
timeout: float = None,
485+
timeout: Optional[float] = None,
476486
metadata: Sequence[Tuple[str, str]] = (),
477487
) -> webrisk.SearchHashesResponse:
478488
r"""Gets the full hashes that match the requested hash
@@ -499,7 +509,7 @@ async def sample_search_hashes():
499509
500510
# Initialize request argument(s)
501511
request = webrisk_v1.SearchHashesRequest(
502-
threat_types="SOCIAL_ENGINEERING_EXTENDED_COVERAGE",
512+
threat_types=['SOCIAL_ENGINEERING_EXTENDED_COVERAGE'],
503513
)
504514
505515
# Make the request
@@ -509,7 +519,7 @@ async def sample_search_hashes():
509519
print(response)
510520
511521
Args:
512-
request (Union[google.cloud.webrisk_v1.types.SearchHashesRequest, dict]):
522+
request (Optional[Union[google.cloud.webrisk_v1.types.SearchHashesRequest, dict]]):
513523
The request object. Request to return full hashes
514524
matched by the provided hash prefixes.
515525
hash_prefix (:class:`bytes`):
@@ -524,7 +534,7 @@ async def sample_search_hashes():
524534
This corresponds to the ``hash_prefix`` field
525535
on the ``request`` instance; if ``request`` is provided, this
526536
should not be set.
527-
threat_types (:class:`Sequence[google.cloud.webrisk_v1.types.ThreatType]`):
537+
threat_types (:class:`MutableSequence[google.cloud.webrisk_v1.types.ThreatType]`):
528538
Required. The ThreatLists to search
529539
in. Multiple ThreatLists may be
530540
specified.
@@ -592,12 +602,12 @@ async def sample_search_hashes():
592602

593603
async def create_submission(
594604
self,
595-
request: Union[webrisk.CreateSubmissionRequest, dict] = None,
605+
request: Optional[Union[webrisk.CreateSubmissionRequest, dict]] = None,
596606
*,
597-
parent: str = None,
598-
submission: webrisk.Submission = None,
607+
parent: Optional[str] = None,
608+
submission: Optional[webrisk.Submission] = None,
599609
retry: OptionalRetry = gapic_v1.method.DEFAULT,
600-
timeout: float = None,
610+
timeout: Optional[float] = None,
601611
metadata: Sequence[Tuple[str, str]] = (),
602612
) -> webrisk.Submission:
603613
r"""Creates a Submission of a URI suspected of containing phishing
@@ -641,7 +651,7 @@ async def sample_create_submission():
641651
print(response)
642652
643653
Args:
644-
request (Union[google.cloud.webrisk_v1.types.CreateSubmissionRequest, dict]):
654+
request (Optional[Union[google.cloud.webrisk_v1.types.CreateSubmissionRequest, dict]]):
645655
The request object. Request to send a potentially phishy
646656
URI to WebRisk.
647657
parent (:class:`str`):

‎google/cloud/webrisk_v1/services/web_risk_service/client.py

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,18 @@
1616
from collections import OrderedDict
1717
import os
1818
import re
19-
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
19+
from typing import (
20+
Dict,
21+
Mapping,
22+
MutableMapping,
23+
MutableSequence,
24+
Optional,
25+
Sequence,
26+
Tuple,
27+
Type,
28+
Union,
29+
cast,
30+
)
2031

2132
from google.api_core import client_options as client_options_lib
2233
from google.api_core import exceptions as core_exceptions
@@ -59,7 +70,7 @@ class WebRiskServiceClientMeta(type):
5970

6071
def get_transport_class(
6172
cls,
62-
label: str = None,
73+
label: Optional[str] = None,
6374
) -> Type[WebRiskServiceTransport]:
6475
"""Returns an appropriate transport class.
6576
@@ -314,8 +325,8 @@ def __init__(
314325
self,
315326
*,
316327
credentials: Optional[ga_credentials.Credentials] = None,
317-
transport: Union[str, WebRiskServiceTransport, None] = None,
318-
client_options: Optional[client_options_lib.ClientOptions] = None,
328+
transport: Optional[Union[str, WebRiskServiceTransport]] = None,
329+
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
319330
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
320331
) -> None:
321332
"""Instantiates the web risk service client.
@@ -329,7 +340,7 @@ def __init__(
329340
transport (Union[str, WebRiskServiceTransport]): The
330341
transport to use. If set to None, a transport is chosen
331342
automatically.
332-
client_options (google.api_core.client_options.ClientOptions): Custom options for the
343+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
333344
client. It won't take effect if a ``transport`` instance is provided.
334345
(1) The ``api_endpoint`` property can be used to override the
335346
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -359,6 +370,7 @@ def __init__(
359370
client_options = client_options_lib.from_dict(client_options)
360371
if client_options is None:
361372
client_options = client_options_lib.ClientOptions()
373+
client_options = cast(client_options_lib.ClientOptions, client_options)
362374

363375
api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
364376
client_options
@@ -411,13 +423,13 @@ def __init__(
411423

412424
def compute_threat_list_diff(
413425
self,
414-
request: Union[webrisk.ComputeThreatListDiffRequest, dict] = None,
426+
request: Optional[Union[webrisk.ComputeThreatListDiffRequest, dict]] = None,
415427
*,
416-
threat_type: webrisk.ThreatType = None,
417-
version_token: bytes = None,
418-
constraints: webrisk.ComputeThreatListDiffRequest.Constraints = None,
428+
threat_type: Optional[webrisk.ThreatType] = None,
429+
version_token: Optional[bytes] = None,
430+
constraints: Optional[webrisk.ComputeThreatListDiffRequest.Constraints] = None,
419431
retry: OptionalRetry = gapic_v1.method.DEFAULT,
420-
timeout: float = None,
432+
timeout: Optional[float] = None,
421433
metadata: Sequence[Tuple[str, str]] = (),
422434
) -> webrisk.ComputeThreatListDiffResponse:
423435
r"""Gets the most recent threat list diffs. These diffs
@@ -541,12 +553,12 @@ def sample_compute_threat_list_diff():
541553

542554
def search_uris(
543555
self,
544-
request: Union[webrisk.SearchUrisRequest, dict] = None,
556+
request: Optional[Union[webrisk.SearchUrisRequest, dict]] = None,
545557
*,
546-
uri: str = None,
547-
threat_types: Sequence[webrisk.ThreatType] = None,
558+
uri: Optional[str] = None,
559+
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
548560
retry: OptionalRetry = gapic_v1.method.DEFAULT,
549-
timeout: float = None,
561+
timeout: Optional[float] = None,
550562
metadata: Sequence[Tuple[str, str]] = (),
551563
) -> webrisk.SearchUrisResponse:
552564
r"""This method is used to check whether a URI is on a
@@ -574,7 +586,7 @@ def sample_search_uris():
574586
# Initialize request argument(s)
575587
request = webrisk_v1.SearchUrisRequest(
576588
uri="uri_value",
577-
threat_types="SOCIAL_ENGINEERING_EXTENDED_COVERAGE",
589+
threat_types=['SOCIAL_ENGINEERING_EXTENDED_COVERAGE'],
578590
)
579591
580592
# Make the request
@@ -594,7 +606,7 @@ def sample_search_uris():
594606
This corresponds to the ``uri`` field
595607
on the ``request`` instance; if ``request`` is provided, this
596608
should not be set.
597-
threat_types (Sequence[google.cloud.webrisk_v1.types.ThreatType]):
609+
threat_types (MutableSequence[google.cloud.webrisk_v1.types.ThreatType]):
598610
Required. The ThreatLists to search
599611
in. Multiple ThreatLists may be
600612
specified.
@@ -652,12 +664,12 @@ def sample_search_uris():
652664

653665
def search_hashes(
654666
self,
655-
request: Union[webrisk.SearchHashesRequest, dict] = None,
667+
request: Optional[Union[webrisk.SearchHashesRequest, dict]] = None,
656668
*,
657-
hash_prefix: bytes = None,
658-
threat_types: Sequence[webrisk.ThreatType] = None,
669+
hash_prefix: Optional[bytes] = None,
670+
threat_types: Optional[MutableSequence[webrisk.ThreatType]] = None,
659671
retry: OptionalRetry = gapic_v1.method.DEFAULT,
660-
timeout: float = None,
672+
timeout: Optional[float] = None,
661673
metadata: Sequence[Tuple[str, str]] = (),
662674
) -> webrisk.SearchHashesResponse:
663675
r"""Gets the full hashes that match the requested hash
@@ -684,7 +696,7 @@ def sample_search_hashes():
684696
685697
# Initialize request argument(s)
686698
request = webrisk_v1.SearchHashesRequest(
687-
threat_types="SOCIAL_ENGINEERING_EXTENDED_COVERAGE",
699+
threat_types=['SOCIAL_ENGINEERING_EXTENDED_COVERAGE'],
688700
)
689701
690702
# Make the request
@@ -709,7 +721,7 @@ def sample_search_hashes():
709721
This corresponds to the ``hash_prefix`` field
710722
on the ``request`` instance; if ``request`` is provided, this
711723
should not be set.
712-
threat_types (Sequence[google.cloud.webrisk_v1.types.ThreatType]):
724+
threat_types (MutableSequence[google.cloud.webrisk_v1.types.ThreatType]):
713725
Required. The ThreatLists to search
714726
in. Multiple ThreatLists may be
715727
specified.
@@ -767,12 +779,12 @@ def sample_search_hashes():
767779

768780
def create_submission(
769781
self,
770-
request: Union[webrisk.CreateSubmissionRequest, dict] = None,
782+
request: Optional[Union[webrisk.CreateSubmissionRequest, dict]] = None,
771783
*,
772-
parent: str = None,
773-
submission: webrisk.Submission = None,
784+
parent: Optional[str] = None,
785+
submission: Optional[webrisk.Submission] = None,
774786
retry: OptionalRetry = gapic_v1.method.DEFAULT,
775-
timeout: float = None,
787+
timeout: Optional[float] = None,
776788
metadata: Sequence[Tuple[str, str]] = (),
777789
) -> webrisk.Submission:
778790
r"""Creates a Submission of a URI suspected of containing phishing

0 commit comments

Comments
 (0)