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

Commit eaaca48

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#510)
* 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 * 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 * 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 * move version to gapic_version.py; clean up setup.py and owlbot.py * configure release-please to use manifest * set coverage level to 99% * remove commented code * customize testing/constraints-3.7.txt * 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: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b 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 * add gapic_version.py Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent cc7ea6c commit eaaca48

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1564
-1322
lines changed

.coveragerc

-5
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ exclude_lines =
1010
pragma: NO COVER
1111
# Ignore debug-only repr
1212
def __repr__
13-
# Ignore pkg_resources exceptions.
14-
# This is added at the module level as a safeguard for if someone
15-
# generates the code and tries to run it without pip installing. This
16-
# makes it virtually impossible to test properly.
17-
except pkg_resources.DistributionNotFound

.github/release-please.yml

+1
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

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
".": "2.11.3"
3+
}
4+

docs/index.rst

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
.. include:: multiprocessing.rst
44

5-
Api Reference
5+
6+
API Reference
67
-------------
78
.. toctree::
89
:maxdepth: 2
@@ -11,20 +12,22 @@ Api Reference
1112
monitoring_v3/services
1213
monitoring_v3/types
1314

15+
1416
Migration Guide
1517
---------------
1618

17-
See the guide below for instructions on migrating to the 2.x release of this library.
19+
See the guide below for instructions on migrating to the latest version.
1820

1921
.. toctree::
2022
:maxdepth: 2
2123

22-
UPGRADING
24+
 UPGRADING
25+
2326

2427
Changelog
2528
---------
2629

27-
For a list of all previous ``google-cloud-monitoring`` releases.
30+
For a list of all ``google-cloud-monitoring`` releases:
2831

2932
.. toctree::
3033
:maxdepth: 2

docs/monitoring_v3/types.rst

-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ Types for Google Cloud Monitoring v3 API
33

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

google/cloud/monitoring/__init__.py

+4
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.monitoring import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from google.cloud.monitoring_v3.services.alert_policy_service.client import (
1822
AlertPolicyServiceClient,
+16
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__ = "2.11.3" # {x-release-please-version}

google/cloud/monitoring_v3/__init__.py

+4
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.monitoring import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from .services.alert_policy_service import AlertPolicyServiceClient
1822
from .services.alert_policy_service import AlertPolicyServiceAsyncClient
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__ = "2.11.3" # {x-release-please-version}

google/cloud/monitoring_v3/services/alert_policy_service/async_client.py

+40-34
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,19 @@
1616
from collections import OrderedDict
1717
import functools
1818
import re
19-
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
20-
import pkg_resources
19+
from typing import (
20+
Dict,
21+
Mapping,
22+
MutableMapping,
23+
MutableSequence,
24+
Optional,
25+
Sequence,
26+
Tuple,
27+
Type,
28+
Union,
29+
)
30+
31+
from google.cloud.monitoring_v3 import gapic_version as package_version
2132

2233
from google.api_core.client_options import ClientOptions
2334
from google.api_core import exceptions as core_exceptions
@@ -181,9 +192,9 @@ def transport(self) -> AlertPolicyServiceTransport:
181192
def __init__(
182193
self,
183194
*,
184-
credentials: ga_credentials.Credentials = None,
195+
credentials: Optional[ga_credentials.Credentials] = None,
185196
transport: Union[str, AlertPolicyServiceTransport] = "grpc_asyncio",
186-
client_options: ClientOptions = None,
197+
client_options: Optional[ClientOptions] = None,
187198
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
188199
) -> None:
189200
"""Instantiates the alert policy service client.
@@ -227,11 +238,11 @@ def __init__(
227238

228239
async def list_alert_policies(
229240
self,
230-
request: Union[alert_service.ListAlertPoliciesRequest, dict] = None,
241+
request: Optional[Union[alert_service.ListAlertPoliciesRequest, dict]] = None,
231242
*,
232-
name: str = None,
243+
name: Optional[str] = None,
233244
retry: OptionalRetry = gapic_v1.method.DEFAULT,
234-
timeout: float = None,
245+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
235246
metadata: Sequence[Tuple[str, str]] = (),
236247
) -> pagers.ListAlertPoliciesAsyncPager:
237248
r"""Lists the existing alerting policies for the
@@ -265,7 +276,7 @@ async def sample_list_alert_policies():
265276
print(response)
266277
267278
Args:
268-
request (Union[google.cloud.monitoring_v3.types.ListAlertPoliciesRequest, dict]):
279+
request (Optional[Union[google.cloud.monitoring_v3.types.ListAlertPoliciesRequest, dict]]):
269280
The request object. The protocol for the
270281
`ListAlertPolicies` request.
271282
name (:class:`str`):
@@ -362,11 +373,11 @@ async def sample_list_alert_policies():
362373

363374
async def get_alert_policy(
364375
self,
365-
request: Union[alert_service.GetAlertPolicyRequest, dict] = None,
376+
request: Optional[Union[alert_service.GetAlertPolicyRequest, dict]] = None,
366377
*,
367-
name: str = None,
378+
name: Optional[str] = None,
368379
retry: OptionalRetry = gapic_v1.method.DEFAULT,
369-
timeout: float = None,
380+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
370381
metadata: Sequence[Tuple[str, str]] = (),
371382
) -> alert.AlertPolicy:
372383
r"""Gets a single alerting policy.
@@ -398,7 +409,7 @@ async def sample_get_alert_policy():
398409
print(response)
399410
400411
Args:
401-
request (Union[google.cloud.monitoring_v3.types.GetAlertPolicyRequest, dict]):
412+
request (Optional[Union[google.cloud.monitoring_v3.types.GetAlertPolicyRequest, dict]]):
402413
The request object. The protocol for the
403414
`GetAlertPolicy` request.
404415
name (:class:`str`):
@@ -480,12 +491,12 @@ async def sample_get_alert_policy():
480491

481492
async def create_alert_policy(
482493
self,
483-
request: Union[alert_service.CreateAlertPolicyRequest, dict] = None,
494+
request: Optional[Union[alert_service.CreateAlertPolicyRequest, dict]] = None,
484495
*,
485-
name: str = None,
486-
alert_policy: alert.AlertPolicy = None,
496+
name: Optional[str] = None,
497+
alert_policy: Optional[alert.AlertPolicy] = None,
487498
retry: OptionalRetry = gapic_v1.method.DEFAULT,
488-
timeout: float = None,
499+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
489500
metadata: Sequence[Tuple[str, str]] = (),
490501
) -> alert.AlertPolicy:
491502
r"""Creates a new alerting policy.
@@ -517,7 +528,7 @@ async def sample_create_alert_policy():
517528
print(response)
518529
519530
Args:
520-
request (Union[google.cloud.monitoring_v3.types.CreateAlertPolicyRequest, dict]):
531+
request (Optional[Union[google.cloud.monitoring_v3.types.CreateAlertPolicyRequest, dict]]):
521532
The request object. The protocol for the
522533
`CreateAlertPolicy` request.
523534
name (:class:`str`):
@@ -612,11 +623,11 @@ async def sample_create_alert_policy():
612623

613624
async def delete_alert_policy(
614625
self,
615-
request: Union[alert_service.DeleteAlertPolicyRequest, dict] = None,
626+
request: Optional[Union[alert_service.DeleteAlertPolicyRequest, dict]] = None,
616627
*,
617-
name: str = None,
628+
name: Optional[str] = None,
618629
retry: OptionalRetry = gapic_v1.method.DEFAULT,
619-
timeout: float = None,
630+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
620631
metadata: Sequence[Tuple[str, str]] = (),
621632
) -> None:
622633
r"""Deletes an alerting policy.
@@ -645,7 +656,7 @@ async def sample_delete_alert_policy():
645656
await client.delete_alert_policy(request=request)
646657
647658
Args:
648-
request (Union[google.cloud.monitoring_v3.types.DeleteAlertPolicyRequest, dict]):
659+
request (Optional[Union[google.cloud.monitoring_v3.types.DeleteAlertPolicyRequest, dict]]):
649660
The request object. The protocol for the
650661
`DeleteAlertPolicy` request.
651662
name (:class:`str`):
@@ -717,12 +728,12 @@ async def sample_delete_alert_policy():
717728

718729
async def update_alert_policy(
719730
self,
720-
request: Union[alert_service.UpdateAlertPolicyRequest, dict] = None,
731+
request: Optional[Union[alert_service.UpdateAlertPolicyRequest, dict]] = None,
721732
*,
722-
update_mask: field_mask_pb2.FieldMask = None,
723-
alert_policy: alert.AlertPolicy = None,
733+
update_mask: Optional[field_mask_pb2.FieldMask] = None,
734+
alert_policy: Optional[alert.AlertPolicy] = None,
724735
retry: OptionalRetry = gapic_v1.method.DEFAULT,
725-
timeout: float = None,
736+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
726737
metadata: Sequence[Tuple[str, str]] = (),
727738
) -> alert.AlertPolicy:
728739
r"""Updates an alerting policy. You can either replace the entire
@@ -756,7 +767,7 @@ async def sample_update_alert_policy():
756767
print(response)
757768
758769
Args:
759-
request (Union[google.cloud.monitoring_v3.types.UpdateAlertPolicyRequest, dict]):
770+
request (Optional[Union[google.cloud.monitoring_v3.types.UpdateAlertPolicyRequest, dict]]):
760771
The request object. The protocol for the
761772
`UpdateAlertPolicy` request.
762773
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
@@ -869,14 +880,9 @@ async def __aexit__(self, exc_type, exc, tb):
869880
await self.transport.close()
870881

871882

872-
try:
873-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
874-
gapic_version=pkg_resources.get_distribution(
875-
"google-cloud-monitoring",
876-
).version,
877-
)
878-
except pkg_resources.DistributionNotFound:
879-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
883+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
884+
gapic_version=package_version.__version__
885+
)
880886

881887

882888
__all__ = ("AlertPolicyServiceAsyncClient",)

0 commit comments

Comments
 (0)