Skip to content

Commit 189add3

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#189)
* 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: googleapis/googleapis-gen@c8aa327 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 * set manifest to true in .github/release-please.yml * add release-please-config.json * 🦉 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: googleapis/googleapis-gen@ab0e217 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: googleapis/googleapis-gen@555c094 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore(python): fix warehouse-package-name for orgpolicy v2 PiperOrigin-RevId: 491637046 Source-Link: googleapis/googleapis@dc4d319 Source-Link: googleapis/googleapis-gen@5c2a267 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWMyYTI2NzU4NjUwMmIxMTBiMTFlNzVmMjA5NzcyMDZjNWU2NjJjZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 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 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * use templated owlbot.py and autogenerated setup.py * update version in gapic_version.py * set coverage level to 97 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 79b4029 commit 189add3

39 files changed

+362
-242
lines changed

packages/google-cloud-org-policy/.coveragerc

Lines changed: 0 additions & 5 deletions
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

packages/google-cloud-org-policy/.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:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.4.1"
3+
}

packages/google-cloud-org-policy/docs/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
21
.. include:: README.rst
32

43
.. include:: multiprocessing.rst
54

5+
66
API Reference
77
-------------
88
.. toctree::
@@ -18,6 +18,6 @@ Changelog
1818
For a list of all ``google-cloud-org-policy`` releases:
1919

2020
.. toctree::
21-
:maxdepth: 2
21+
:maxdepth: 2
2222

23-
changelog
23+
changelog

packages/google-cloud-org-policy/docs/orgpolicy_v2/types.rst

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

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

packages/google-cloud-org-policy/google/cloud/orgpolicy/__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.orgpolicy import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from google.cloud.orgpolicy_v2.services.org_policy.client import OrgPolicyClient
1822
from google.cloud.orgpolicy_v2.services.org_policy.async_client import (
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.4.1" # {x-release-please-version}

packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/__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.orgpolicy import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from .services.org_policy import OrgPolicyClient
1822
from .services.org_policy import OrgPolicyAsyncClient
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.4.1" # {x-release-please-version}

packages/google-cloud-org-policy/google/cloud/orgpolicy_v2/services/org_policy/async_client.py

Lines changed: 47 additions & 41 deletions
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.orgpolicy_v2 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
@@ -177,9 +188,9 @@ def transport(self) -> OrgPolicyTransport:
177188
def __init__(
178189
self,
179190
*,
180-
credentials: ga_credentials.Credentials = None,
191+
credentials: Optional[ga_credentials.Credentials] = None,
181192
transport: Union[str, OrgPolicyTransport] = "grpc_asyncio",
182-
client_options: ClientOptions = None,
193+
client_options: Optional[ClientOptions] = None,
183194
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
184195
) -> None:
185196
"""Instantiates the org policy client.
@@ -223,11 +234,11 @@ def __init__(
223234

224235
async def list_constraints(
225236
self,
226-
request: Union[orgpolicy.ListConstraintsRequest, dict] = None,
237+
request: Optional[Union[orgpolicy.ListConstraintsRequest, dict]] = None,
227238
*,
228-
parent: str = None,
239+
parent: Optional[str] = None,
229240
retry: OptionalRetry = gapic_v1.method.DEFAULT,
230-
timeout: float = None,
241+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
231242
metadata: Sequence[Tuple[str, str]] = (),
232243
) -> pagers.ListConstraintsAsyncPager:
233244
r"""Lists ``Constraints`` that could be applied on the specified
@@ -261,7 +272,7 @@ async def sample_list_constraints():
261272
print(response)
262273
263274
Args:
264-
request (Union[google.cloud.orgpolicy_v2.types.ListConstraintsRequest, dict]):
275+
request (Optional[Union[google.cloud.orgpolicy_v2.types.ListConstraintsRequest, dict]]):
265276
The request object. The request sent to the
266277
[ListConstraints]
267278
[google.cloud.orgpolicy.v2.OrgPolicy.ListConstraints]
@@ -357,11 +368,11 @@ async def sample_list_constraints():
357368

358369
async def list_policies(
359370
self,
360-
request: Union[orgpolicy.ListPoliciesRequest, dict] = None,
371+
request: Optional[Union[orgpolicy.ListPoliciesRequest, dict]] = None,
361372
*,
362-
parent: str = None,
373+
parent: Optional[str] = None,
363374
retry: OptionalRetry = gapic_v1.method.DEFAULT,
364-
timeout: float = None,
375+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
365376
metadata: Sequence[Tuple[str, str]] = (),
366377
) -> pagers.ListPoliciesAsyncPager:
367378
r"""Retrieves all of the ``Policies`` that exist on a particular
@@ -395,7 +406,7 @@ async def sample_list_policies():
395406
print(response)
396407
397408
Args:
398-
request (Union[google.cloud.orgpolicy_v2.types.ListPoliciesRequest, dict]):
409+
request (Optional[Union[google.cloud.orgpolicy_v2.types.ListPoliciesRequest, dict]]):
399410
The request object. The request sent to the
400411
[ListPolicies]
401412
[google.cloud.orgpolicy.v2.OrgPolicy.ListPolicies]
@@ -493,11 +504,11 @@ async def sample_list_policies():
493504

494505
async def get_policy(
495506
self,
496-
request: Union[orgpolicy.GetPolicyRequest, dict] = None,
507+
request: Optional[Union[orgpolicy.GetPolicyRequest, dict]] = None,
497508
*,
498-
name: str = None,
509+
name: Optional[str] = None,
499510
retry: OptionalRetry = gapic_v1.method.DEFAULT,
500-
timeout: float = None,
511+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
501512
metadata: Sequence[Tuple[str, str]] = (),
502513
) -> orgpolicy.Policy:
503514
r"""Gets a ``Policy`` on a resource.
@@ -533,7 +544,7 @@ async def sample_get_policy():
533544
print(response)
534545
535546
Args:
536-
request (Union[google.cloud.orgpolicy_v2.types.GetPolicyRequest, dict]):
547+
request (Optional[Union[google.cloud.orgpolicy_v2.types.GetPolicyRequest, dict]]):
537548
The request object. The request sent to the [GetPolicy]
538549
[google.cloud.orgpolicy.v2.OrgPolicy.GetPolicy] method.
539550
name (:class:`str`):
@@ -609,11 +620,11 @@ async def sample_get_policy():
609620

610621
async def get_effective_policy(
611622
self,
612-
request: Union[orgpolicy.GetEffectivePolicyRequest, dict] = None,
623+
request: Optional[Union[orgpolicy.GetEffectivePolicyRequest, dict]] = None,
613624
*,
614-
name: str = None,
625+
name: Optional[str] = None,
615626
retry: OptionalRetry = gapic_v1.method.DEFAULT,
616-
timeout: float = None,
627+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
617628
metadata: Sequence[Tuple[str, str]] = (),
618629
) -> orgpolicy.Policy:
619630
r"""Gets the effective ``Policy`` on a resource. This is the result
@@ -650,7 +661,7 @@ async def sample_get_effective_policy():
650661
print(response)
651662
652663
Args:
653-
request (Union[google.cloud.orgpolicy_v2.types.GetEffectivePolicyRequest, dict]):
664+
request (Optional[Union[google.cloud.orgpolicy_v2.types.GetEffectivePolicyRequest, dict]]):
654665
The request object. The request sent to the
655666
[GetEffectivePolicy]
656667
[google.cloud.orgpolicy.v2.OrgPolicy.GetEffectivePolicy]
@@ -728,12 +739,12 @@ async def sample_get_effective_policy():
728739

729740
async def create_policy(
730741
self,
731-
request: Union[orgpolicy.CreatePolicyRequest, dict] = None,
742+
request: Optional[Union[orgpolicy.CreatePolicyRequest, dict]] = None,
732743
*,
733-
parent: str = None,
734-
policy: orgpolicy.Policy = None,
744+
parent: Optional[str] = None,
745+
policy: Optional[orgpolicy.Policy] = None,
735746
retry: OptionalRetry = gapic_v1.method.DEFAULT,
736-
timeout: float = None,
747+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
737748
metadata: Sequence[Tuple[str, str]] = (),
738749
) -> orgpolicy.Policy:
739750
r"""Creates a Policy.
@@ -771,7 +782,7 @@ async def sample_create_policy():
771782
print(response)
772783
773784
Args:
774-
request (Union[google.cloud.orgpolicy_v2.types.CreatePolicyRequest, dict]):
785+
request (Optional[Union[google.cloud.orgpolicy_v2.types.CreatePolicyRequest, dict]]):
775786
The request object. The request sent to the
776787
[CreatePolicyRequest]
777788
[google.cloud.orgpolicy.v2.OrgPolicy.CreatePolicy]
@@ -861,11 +872,11 @@ async def sample_create_policy():
861872

862873
async def update_policy(
863874
self,
864-
request: Union[orgpolicy.UpdatePolicyRequest, dict] = None,
875+
request: Optional[Union[orgpolicy.UpdatePolicyRequest, dict]] = None,
865876
*,
866-
policy: orgpolicy.Policy = None,
877+
policy: Optional[orgpolicy.Policy] = None,
867878
retry: OptionalRetry = gapic_v1.method.DEFAULT,
868-
timeout: float = None,
879+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
869880
metadata: Sequence[Tuple[str, str]] = (),
870881
) -> orgpolicy.Policy:
871882
r"""Updates a Policy.
@@ -905,7 +916,7 @@ async def sample_update_policy():
905916
print(response)
906917
907918
Args:
908-
request (Union[google.cloud.orgpolicy_v2.types.UpdatePolicyRequest, dict]):
919+
request (Optional[Union[google.cloud.orgpolicy_v2.types.UpdatePolicyRequest, dict]]):
909920
The request object. The request sent to the
910921
[UpdatePolicyRequest]
911922
[google.cloud.orgpolicy.v2.OrgPolicy.UpdatePolicy]
@@ -983,11 +994,11 @@ async def sample_update_policy():
983994

984995
async def delete_policy(
985996
self,
986-
request: Union[orgpolicy.DeletePolicyRequest, dict] = None,
997+
request: Optional[Union[orgpolicy.DeletePolicyRequest, dict]] = None,
987998
*,
988-
name: str = None,
999+
name: Optional[str] = None,
9891000
retry: OptionalRetry = gapic_v1.method.DEFAULT,
990-
timeout: float = None,
1001+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
9911002
metadata: Sequence[Tuple[str, str]] = (),
9921003
) -> None:
9931004
r"""Deletes a Policy.
@@ -1020,7 +1031,7 @@ async def sample_delete_policy():
10201031
await client.delete_policy(request=request)
10211032
10221033
Args:
1023-
request (Union[google.cloud.orgpolicy_v2.types.DeletePolicyRequest, dict]):
1034+
request (Optional[Union[google.cloud.orgpolicy_v2.types.DeletePolicyRequest, dict]]):
10241035
The request object. The request sent to the
10251036
[DeletePolicy]
10261037
[google.cloud.orgpolicy.v2.OrgPolicy.DeletePolicy]
@@ -1094,14 +1105,9 @@ async def __aexit__(self, exc_type, exc, tb):
10941105
await self.transport.close()
10951106

10961107

1097-
try:
1098-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1099-
gapic_version=pkg_resources.get_distribution(
1100-
"google-cloud-org-policy",
1101-
).version,
1102-
)
1103-
except pkg_resources.DistributionNotFound:
1104-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
1108+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1109+
gapic_version=package_version.__version__
1110+
)
11051111

11061112

11071113
__all__ = ("OrgPolicyAsyncClient",)

0 commit comments

Comments
 (0)