|
34 | 34 | from google.api_core.client_options import ClientOptions
|
35 | 35 | from google.auth import credentials as ga_credentials # type: ignore
|
36 | 36 | from google.oauth2 import service_account # type: ignore
|
37 |
| -import pkg_resources |
| 37 | + |
| 38 | +from google.cloud.devtools.containeranalysis_v1 import gapic_version as package_version |
38 | 39 |
|
39 | 40 | try:
|
40 | 41 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
|
@@ -250,7 +251,7 @@ async def set_iam_policy(
|
250 | 251 | *,
|
251 | 252 | resource: Optional[str] = None,
|
252 | 253 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
253 |
| - timeout: Optional[float] = None, |
| 254 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
254 | 255 | metadata: Sequence[Tuple[str, str]] = (),
|
255 | 256 | ) -> policy_pb2.Policy:
|
256 | 257 | r"""Sets the access control policy on the specified note or
|
@@ -424,7 +425,7 @@ async def get_iam_policy(
|
424 | 425 | *,
|
425 | 426 | resource: Optional[str] = None,
|
426 | 427 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
427 |
| - timeout: Optional[float] = None, |
| 428 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
428 | 429 | metadata: Sequence[Tuple[str, str]] = (),
|
429 | 430 | ) -> policy_pb2.Policy:
|
430 | 431 | r"""Gets the access control policy for a note or an occurrence
|
@@ -599,7 +600,7 @@ async def test_iam_permissions(
|
599 | 600 | resource: Optional[str] = None,
|
600 | 601 | permissions: Optional[MutableSequence[str]] = None,
|
601 | 602 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
602 |
| - timeout: Optional[float] = None, |
| 603 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
603 | 604 | metadata: Sequence[Tuple[str, str]] = (),
|
604 | 605 | ) -> iam_policy_pb2.TestIamPermissionsResponse:
|
605 | 606 | r"""Returns the permissions that a caller has on the specified note
|
@@ -725,7 +726,7 @@ async def get_vulnerability_occurrences_summary(
|
725 | 726 | parent: Optional[str] = None,
|
726 | 727 | filter: Optional[str] = None,
|
727 | 728 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
728 |
| - timeout: Optional[float] = None, |
| 729 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
729 | 730 | metadata: Sequence[Tuple[str, str]] = (),
|
730 | 731 | ) -> containeranalysis.VulnerabilityOccurrencesSummary:
|
731 | 732 | r"""Gets a summary of the number and severity of
|
@@ -837,14 +838,9 @@ async def __aexit__(self, exc_type, exc, tb):
|
837 | 838 | await self.transport.close()
|
838 | 839 |
|
839 | 840 |
|
840 |
| -try: |
841 |
| - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
842 |
| - gapic_version=pkg_resources.get_distribution( |
843 |
| - "google-cloud-containeranalysis", |
844 |
| - ).version, |
845 |
| - ) |
846 |
| -except pkg_resources.DistributionNotFound: |
847 |
| - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 841 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 842 | + gapic_version=package_version.__version__ |
| 843 | +) |
848 | 844 |
|
849 | 845 |
|
850 | 846 | __all__ = ("ContainerAnalysisAsyncClient",)
|
0 commit comments