Skip to content

Commit

Permalink
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#251)
Browse files Browse the repository at this point in the history
* fix(deps): Require google-api-core >=1.34.0, >=2.11.0

fix: Drop usage of pkg_resources

fix: Fix timeout default values

docs(samples): Snippetgen should call await on the operation coroutine before calling result

PiperOrigin-RevId: 493260409

Source-Link: googleapis/googleapis@fea4387

Source-Link: googleapis/googleapis-gen@387b734
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* add gapic_version.py

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people committed Dec 6, 2022
1 parent a7959ae commit 295017c
Show file tree
Hide file tree
Showing 16 changed files with 173 additions and 166 deletions.
5 changes: 0 additions & 5 deletions packages/google-cloud-websecurityscanner/.coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ exclude_lines =
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.9.2" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
from google.api_core.client_options import ClientOptions
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.websecurityscanner_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
Expand Down Expand Up @@ -237,7 +238,7 @@ async def create_scan_config(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_config.ScanConfig:
r"""Creates a new ScanConfig.
Expand Down Expand Up @@ -318,7 +319,7 @@ async def delete_scan_config(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes an existing ScanConfig and its child
Expand Down Expand Up @@ -398,7 +399,7 @@ async def get_scan_config(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_config.ScanConfig:
r"""Gets a ScanConfig.
Expand Down Expand Up @@ -489,7 +490,7 @@ async def list_scan_configs(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListScanConfigsAsyncPager:
r"""Lists ScanConfigs under a given project.
Expand Down Expand Up @@ -592,7 +593,7 @@ async def update_scan_config(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_config.ScanConfig:
r"""Updates a ScanConfig. This method support partial
Expand Down Expand Up @@ -674,7 +675,7 @@ async def start_scan_run(
request: Optional[Union[web_security_scanner.StartScanRunRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_run.ScanRun:
r"""Start a ScanRun according to the given ScanConfig.
Expand Down Expand Up @@ -754,7 +755,7 @@ async def get_scan_run(
request: Optional[Union[web_security_scanner.GetScanRunRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_run.ScanRun:
r"""Gets a ScanRun.
Expand Down Expand Up @@ -843,7 +844,7 @@ async def list_scan_runs(
request: Optional[Union[web_security_scanner.ListScanRunsRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListScanRunsAsyncPager:
r"""Lists ScanRuns under a given ScanConfig, in
Expand Down Expand Up @@ -945,7 +946,7 @@ async def stop_scan_run(
request: Optional[Union[web_security_scanner.StopScanRunRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_run.ScanRun:
r"""Stops a ScanRun. The stopped ScanRun is returned.
Expand Down Expand Up @@ -1027,7 +1028,7 @@ async def list_crawled_urls(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListCrawledUrlsAsyncPager:
r"""List CrawledUrls under a given ScanRun.
Expand Down Expand Up @@ -1128,7 +1129,7 @@ async def get_finding(
request: Optional[Union[web_security_scanner.GetFindingRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> finding.Finding:
r"""Gets a Finding.
Expand Down Expand Up @@ -1217,7 +1218,7 @@ async def list_findings(
request: Optional[Union[web_security_scanner.ListFindingsRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListFindingsAsyncPager:
r"""List Findings under a given ScanRun.
Expand Down Expand Up @@ -1320,7 +1321,7 @@ async def list_finding_type_stats(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> web_security_scanner.ListFindingTypeStatsResponse:
r"""List all FindingTypeStats under a given ScanRun.
Expand Down Expand Up @@ -1409,14 +1410,9 @@ async def __aexit__(self, exc_type, exc, tb):
await self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-websecurityscanner",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("WebSecurityScannerAsyncClient",)
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.websecurityscanner_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
Expand Down Expand Up @@ -465,7 +466,7 @@ def create_scan_config(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_config.ScanConfig:
r"""Creates a new ScanConfig.
Expand Down Expand Up @@ -547,7 +548,7 @@ def delete_scan_config(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes an existing ScanConfig and its child
Expand Down Expand Up @@ -618,7 +619,7 @@ def get_scan_config(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_config.ScanConfig:
r"""Gets a ScanConfig.
Expand Down Expand Up @@ -700,7 +701,7 @@ def list_scan_configs(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListScanConfigsPager:
r"""Lists ScanConfigs under a given project.
Expand Down Expand Up @@ -794,7 +795,7 @@ def update_scan_config(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_config.ScanConfig:
r"""Updates a ScanConfig. This method support partial
Expand Down Expand Up @@ -877,7 +878,7 @@ def start_scan_run(
request: Optional[Union[web_security_scanner.StartScanRunRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_run.ScanRun:
r"""Start a ScanRun according to the given ScanConfig.
Expand Down Expand Up @@ -958,7 +959,7 @@ def get_scan_run(
request: Optional[Union[web_security_scanner.GetScanRunRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_run.ScanRun:
r"""Gets a ScanRun.
Expand Down Expand Up @@ -1038,7 +1039,7 @@ def list_scan_runs(
request: Optional[Union[web_security_scanner.ListScanRunsRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListScanRunsPager:
r"""Lists ScanRuns under a given ScanConfig, in
Expand Down Expand Up @@ -1131,7 +1132,7 @@ def stop_scan_run(
request: Optional[Union[web_security_scanner.StopScanRunRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> scan_run.ScanRun:
r"""Stops a ScanRun. The stopped ScanRun is returned.
Expand Down Expand Up @@ -1214,7 +1215,7 @@ def list_crawled_urls(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListCrawledUrlsPager:
r"""List CrawledUrls under a given ScanRun.
Expand Down Expand Up @@ -1306,7 +1307,7 @@ def get_finding(
request: Optional[Union[web_security_scanner.GetFindingRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> finding.Finding:
r"""Gets a Finding.
Expand Down Expand Up @@ -1386,7 +1387,7 @@ def list_findings(
request: Optional[Union[web_security_scanner.ListFindingsRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListFindingsPager:
r"""List Findings under a given ScanRun.
Expand Down Expand Up @@ -1480,7 +1481,7 @@ def list_finding_type_stats(
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> web_security_scanner.ListFindingTypeStatsResponse:
r"""List all FindingTypeStats under a given ScanRun.
Expand Down Expand Up @@ -1567,14 +1568,9 @@ def __exit__(self, type, value, traceback):
self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-websecurityscanner",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("WebSecurityScannerClient",)
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,18 @@
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
from google.protobuf import empty_pb2 # type: ignore
import pkg_resources

from google.cloud.websecurityscanner_v1 import gapic_version as package_version
from google.cloud.websecurityscanner_v1.types import (
finding,
scan_config,
scan_run,
web_security_scanner,
)

try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-websecurityscanner",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


class WebSecurityScannerTransport(abc.ABC):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.9.2" # {x-release-please-version}
Loading

0 comments on commit 295017c

Please sign in to comment.