Skip to content
This repository was archived by the owner on Mar 15, 2025. It is now read-only.

Commit 078feca

Browse files
fix: regenerate pb2 files for compatibility with protobuf 5.x (#304)
* fix: regenerate pb2 files for compatibility with protobuf 5.x * update constraints * fix build * filter downstream warnings * filter downstream warning * use temporary directory when testing remote GAPIC * lint * 🦉 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>
1 parent c829089 commit 078feca

File tree

23 files changed

+319
-232
lines changed

23 files changed

+319
-232
lines changed

.github/workflows/unittest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
COVERAGE_FILE: .coverage-${{ matrix.python }}
2626
run: |
2727
nox -s unit-${{ matrix.python }}
28+
nox -s unit_remote-${{ matrix.python }}
2829
- name: Upload coverage results
2930
uses: actions/upload-artifact@v4
3031
with:

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
# All configuration values have a default; values that are commented out
2525
# serve to show the default.
2626

27-
import sys
2827
import os
2928
import shlex
29+
import sys
3030

3131
# If extensions (or modules to document with autodoc) are in another directory,
3232
# add these directories to sys.path here. If the directory is relative to the

google/cloud/orgpolicy/__init__.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,31 @@
1818
__version__ = package_version.__version__
1919

2020

21-
from google.cloud.orgpolicy_v2.services.org_policy.client import OrgPolicyClient
2221
from google.cloud.orgpolicy_v2.services.org_policy.async_client import (
2322
OrgPolicyAsyncClient,
2423
)
25-
26-
from google.cloud.orgpolicy_v2.types.constraint import Constraint
27-
from google.cloud.orgpolicy_v2.types.constraint import CustomConstraint
28-
from google.cloud.orgpolicy_v2.types.orgpolicy import AlternatePolicySpec
29-
from google.cloud.orgpolicy_v2.types.orgpolicy import CreateCustomConstraintRequest
30-
from google.cloud.orgpolicy_v2.types.orgpolicy import CreatePolicyRequest
31-
from google.cloud.orgpolicy_v2.types.orgpolicy import DeleteCustomConstraintRequest
32-
from google.cloud.orgpolicy_v2.types.orgpolicy import DeletePolicyRequest
33-
from google.cloud.orgpolicy_v2.types.orgpolicy import GetCustomConstraintRequest
34-
from google.cloud.orgpolicy_v2.types.orgpolicy import GetEffectivePolicyRequest
35-
from google.cloud.orgpolicy_v2.types.orgpolicy import GetPolicyRequest
36-
from google.cloud.orgpolicy_v2.types.orgpolicy import ListConstraintsRequest
37-
from google.cloud.orgpolicy_v2.types.orgpolicy import ListConstraintsResponse
38-
from google.cloud.orgpolicy_v2.types.orgpolicy import ListCustomConstraintsRequest
39-
from google.cloud.orgpolicy_v2.types.orgpolicy import ListCustomConstraintsResponse
40-
from google.cloud.orgpolicy_v2.types.orgpolicy import ListPoliciesRequest
41-
from google.cloud.orgpolicy_v2.types.orgpolicy import ListPoliciesResponse
42-
from google.cloud.orgpolicy_v2.types.orgpolicy import Policy
43-
from google.cloud.orgpolicy_v2.types.orgpolicy import PolicySpec
44-
from google.cloud.orgpolicy_v2.types.orgpolicy import UpdateCustomConstraintRequest
45-
from google.cloud.orgpolicy_v2.types.orgpolicy import UpdatePolicyRequest
24+
from google.cloud.orgpolicy_v2.services.org_policy.client import OrgPolicyClient
25+
from google.cloud.orgpolicy_v2.types.constraint import Constraint, CustomConstraint
26+
from google.cloud.orgpolicy_v2.types.orgpolicy import (
27+
AlternatePolicySpec,
28+
CreateCustomConstraintRequest,
29+
CreatePolicyRequest,
30+
DeleteCustomConstraintRequest,
31+
DeletePolicyRequest,
32+
GetCustomConstraintRequest,
33+
GetEffectivePolicyRequest,
34+
GetPolicyRequest,
35+
ListConstraintsRequest,
36+
ListConstraintsResponse,
37+
ListCustomConstraintsRequest,
38+
ListCustomConstraintsResponse,
39+
ListPoliciesRequest,
40+
ListPoliciesResponse,
41+
Policy,
42+
PolicySpec,
43+
UpdateCustomConstraintRequest,
44+
UpdatePolicyRequest,
45+
)
4646

4747
__all__ = (
4848
"OrgPolicyClient",

google/cloud/orgpolicy/v1/orgpolicy_pb2.py

Lines changed: 15 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
"""Generated protocol buffer code."""
2020
from google.protobuf import descriptor as _descriptor
2121
from google.protobuf import descriptor_pool as _descriptor_pool
22-
from google.protobuf import message as _message
23-
from google.protobuf import reflection as _reflection
2422
from google.protobuf import symbol_database as _symbol_database
23+
from google.protobuf.internal import builder as _builder
2524

2625
# @@protoc_insertion_point(imports)
2726

@@ -30,70 +29,26 @@
3029

3130
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
3231

33-
3432
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
3533
b'\n)google/cloud/orgpolicy/v1/orgpolicy.proto\x12\x19google.cloud.orgpolicy.v1\x1a\x1fgoogle/protobuf/timestamp.proto"\x8b\x05\n\x06Policy\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12\x12\n\nconstraint\x18\x02 \x01(\t\x12\x0c\n\x04\x65tag\x18\x03 \x01(\x0c\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x43\n\x0blist_policy\x18\x05 \x01(\x0b\x32,.google.cloud.orgpolicy.v1.Policy.ListPolicyH\x00\x12I\n\x0e\x62oolean_policy\x18\x06 \x01(\x0b\x32/.google.cloud.orgpolicy.v1.Policy.BooleanPolicyH\x00\x12K\n\x0frestore_default\x18\x07 \x01(\x0b\x32\x30.google.cloud.orgpolicy.v1.Policy.RestoreDefaultH\x00\x1a\xfb\x01\n\nListPolicy\x12\x16\n\x0e\x61llowed_values\x18\x01 \x03(\t\x12\x15\n\rdenied_values\x18\x02 \x03(\t\x12J\n\nall_values\x18\x03 \x01(\x0e\x32\x36.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues\x12\x17\n\x0fsuggested_value\x18\x04 \x01(\t\x12\x1b\n\x13inherit_from_parent\x18\x05 \x01(\x08"<\n\tAllValues\x12\x1a\n\x16\x41LL_VALUES_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x08\n\x04\x44\x45NY\x10\x02\x1a!\n\rBooleanPolicy\x12\x10\n\x08\x65nforced\x18\x01 \x01(\x08\x1a\x10\n\x0eRestoreDefaultB\r\n\x0bpolicy_typeB\xc5\x01\n\x1d\x63om.google.cloud.orgpolicy.v1B\x0eOrgPolicyProtoP\x01Z;cloud.google.com/go/orgpolicy/apiv1/orgpolicypb;orgpolicypb\xaa\x02\x19Google.Cloud.OrgPolicy.V1\xca\x02\x19Google\\Cloud\\OrgPolicy\\V1\xea\x02\x1cGoogle::Cloud::OrgPolicy::V1b\x06proto3'
3634
)
3735

38-
39-
_POLICY = DESCRIPTOR.message_types_by_name["Policy"]
40-
_POLICY_LISTPOLICY = _POLICY.nested_types_by_name["ListPolicy"]
41-
_POLICY_BOOLEANPOLICY = _POLICY.nested_types_by_name["BooleanPolicy"]
42-
_POLICY_RESTOREDEFAULT = _POLICY.nested_types_by_name["RestoreDefault"]
43-
_POLICY_LISTPOLICY_ALLVALUES = _POLICY_LISTPOLICY.enum_types_by_name["AllValues"]
44-
Policy = _reflection.GeneratedProtocolMessageType(
45-
"Policy",
46-
(_message.Message,),
47-
{
48-
"ListPolicy": _reflection.GeneratedProtocolMessageType(
49-
"ListPolicy",
50-
(_message.Message,),
51-
{
52-
"DESCRIPTOR": _POLICY_LISTPOLICY,
53-
"__module__": "google.cloud.orgpolicy.v1.orgpolicy_pb2"
54-
# @@protoc_insertion_point(class_scope:google.cloud.orgpolicy.v1.Policy.ListPolicy)
55-
},
56-
),
57-
"BooleanPolicy": _reflection.GeneratedProtocolMessageType(
58-
"BooleanPolicy",
59-
(_message.Message,),
60-
{
61-
"DESCRIPTOR": _POLICY_BOOLEANPOLICY,
62-
"__module__": "google.cloud.orgpolicy.v1.orgpolicy_pb2"
63-
# @@protoc_insertion_point(class_scope:google.cloud.orgpolicy.v1.Policy.BooleanPolicy)
64-
},
65-
),
66-
"RestoreDefault": _reflection.GeneratedProtocolMessageType(
67-
"RestoreDefault",
68-
(_message.Message,),
69-
{
70-
"DESCRIPTOR": _POLICY_RESTOREDEFAULT,
71-
"__module__": "google.cloud.orgpolicy.v1.orgpolicy_pb2"
72-
# @@protoc_insertion_point(class_scope:google.cloud.orgpolicy.v1.Policy.RestoreDefault)
73-
},
74-
),
75-
"DESCRIPTOR": _POLICY,
76-
"__module__": "google.cloud.orgpolicy.v1.orgpolicy_pb2"
77-
# @@protoc_insertion_point(class_scope:google.cloud.orgpolicy.v1.Policy)
78-
},
36+
_globals = globals()
37+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
38+
_builder.BuildTopDescriptorsAndMessages(
39+
DESCRIPTOR, "google.cloud.orgpolicy.v1.orgpolicy_pb2", _globals
7940
)
80-
_sym_db.RegisterMessage(Policy)
81-
_sym_db.RegisterMessage(Policy.ListPolicy)
82-
_sym_db.RegisterMessage(Policy.BooleanPolicy)
83-
_sym_db.RegisterMessage(Policy.RestoreDefault)
84-
8541
if _descriptor._USE_C_DESCRIPTORS == False:
86-
8742
DESCRIPTOR._options = None
8843
DESCRIPTOR._serialized_options = b"\n\035com.google.cloud.orgpolicy.v1B\016OrgPolicyProtoP\001Z;cloud.google.com/go/orgpolicy/apiv1/orgpolicypb;orgpolicypb\252\002\031Google.Cloud.OrgPolicy.V1\312\002\031Google\\Cloud\\OrgPolicy\\V1\352\002\034Google::Cloud::OrgPolicy::V1"
89-
_POLICY._serialized_start = 106
90-
_POLICY._serialized_end = 757
91-
_POLICY_LISTPOLICY._serialized_start = 438
92-
_POLICY_LISTPOLICY._serialized_end = 689
93-
_POLICY_LISTPOLICY_ALLVALUES._serialized_start = 629
94-
_POLICY_LISTPOLICY_ALLVALUES._serialized_end = 689
95-
_POLICY_BOOLEANPOLICY._serialized_start = 691
96-
_POLICY_BOOLEANPOLICY._serialized_end = 724
97-
_POLICY_RESTOREDEFAULT._serialized_start = 726
98-
_POLICY_RESTOREDEFAULT._serialized_end = 742
44+
_globals["_POLICY"]._serialized_start = 106
45+
_globals["_POLICY"]._serialized_end = 757
46+
_globals["_POLICY_LISTPOLICY"]._serialized_start = 438
47+
_globals["_POLICY_LISTPOLICY"]._serialized_end = 689
48+
_globals["_POLICY_LISTPOLICY_ALLVALUES"]._serialized_start = 629
49+
_globals["_POLICY_LISTPOLICY_ALLVALUES"]._serialized_end = 689
50+
_globals["_POLICY_BOOLEANPOLICY"]._serialized_start = 691
51+
_globals["_POLICY_BOOLEANPOLICY"]._serialized_end = 724
52+
_globals["_POLICY_RESTOREDEFAULT"]._serialized_start = 726
53+
_globals["_POLICY_RESTOREDEFAULT"]._serialized_end = 742
9954
# @@protoc_insertion_point(module_scope)

google/cloud/orgpolicy_v2/__init__.py

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,28 @@
1818
__version__ = package_version.__version__
1919

2020

21-
from .services.org_policy import OrgPolicyClient
22-
from .services.org_policy import OrgPolicyAsyncClient
23-
24-
from .types.constraint import Constraint
25-
from .types.constraint import CustomConstraint
26-
from .types.orgpolicy import AlternatePolicySpec
27-
from .types.orgpolicy import CreateCustomConstraintRequest
28-
from .types.orgpolicy import CreatePolicyRequest
29-
from .types.orgpolicy import DeleteCustomConstraintRequest
30-
from .types.orgpolicy import DeletePolicyRequest
31-
from .types.orgpolicy import GetCustomConstraintRequest
32-
from .types.orgpolicy import GetEffectivePolicyRequest
33-
from .types.orgpolicy import GetPolicyRequest
34-
from .types.orgpolicy import ListConstraintsRequest
35-
from .types.orgpolicy import ListConstraintsResponse
36-
from .types.orgpolicy import ListCustomConstraintsRequest
37-
from .types.orgpolicy import ListCustomConstraintsResponse
38-
from .types.orgpolicy import ListPoliciesRequest
39-
from .types.orgpolicy import ListPoliciesResponse
40-
from .types.orgpolicy import Policy
41-
from .types.orgpolicy import PolicySpec
42-
from .types.orgpolicy import UpdateCustomConstraintRequest
43-
from .types.orgpolicy import UpdatePolicyRequest
21+
from .services.org_policy import OrgPolicyAsyncClient, OrgPolicyClient
22+
from .types.constraint import Constraint, CustomConstraint
23+
from .types.orgpolicy import (
24+
AlternatePolicySpec,
25+
CreateCustomConstraintRequest,
26+
CreatePolicyRequest,
27+
DeleteCustomConstraintRequest,
28+
DeletePolicyRequest,
29+
GetCustomConstraintRequest,
30+
GetEffectivePolicyRequest,
31+
GetPolicyRequest,
32+
ListConstraintsRequest,
33+
ListConstraintsResponse,
34+
ListCustomConstraintsRequest,
35+
ListCustomConstraintsResponse,
36+
ListPoliciesRequest,
37+
ListPoliciesResponse,
38+
Policy,
39+
PolicySpec,
40+
UpdateCustomConstraintRequest,
41+
UpdatePolicyRequest,
42+
)
4443

4544
__all__ = (
4645
"OrgPolicyAsyncClient",

google/cloud/orgpolicy_v2/services/org_policy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
from .client import OrgPolicyClient
1716
from .async_client import OrgPolicyAsyncClient
17+
from .client import OrgPolicyClient
1818

1919
__all__ = (
2020
"OrgPolicyClient",

google/cloud/orgpolicy_v2/services/org_policy/async_client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import functools
1818
import re
1919
from typing import (
20-
Dict,
2120
Callable,
21+
Dict,
2222
Mapping,
2323
MutableMapping,
2424
MutableSequence,
@@ -29,28 +29,28 @@
2929
Union,
3030
)
3131

32-
from google.cloud.orgpolicy_v2 import gapic_version as package_version
33-
34-
from google.api_core.client_options import ClientOptions
3532
from google.api_core import exceptions as core_exceptions
3633
from google.api_core import gapic_v1
3734
from google.api_core import retry_async as retries
35+
from google.api_core.client_options import ClientOptions
3836
from google.auth import credentials as ga_credentials # type: ignore
3937
from google.oauth2 import service_account # type: ignore
4038

39+
from google.cloud.orgpolicy_v2 import gapic_version as package_version
4140

4241
try:
4342
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None]
4443
except AttributeError: # pragma: NO COVER
4544
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
4645

47-
from google.cloud.orgpolicy_v2.services.org_policy import pagers
48-
from google.cloud.orgpolicy_v2.types import constraint
49-
from google.cloud.orgpolicy_v2.types import orgpolicy
5046
from google.protobuf import timestamp_pb2 # type: ignore
51-
from .transports.base import OrgPolicyTransport, DEFAULT_CLIENT_INFO
52-
from .transports.grpc_asyncio import OrgPolicyGrpcAsyncIOTransport
47+
48+
from google.cloud.orgpolicy_v2.services.org_policy import pagers
49+
from google.cloud.orgpolicy_v2.types import constraint, orgpolicy
50+
5351
from .client import OrgPolicyClient
52+
from .transports.base import DEFAULT_CLIENT_INFO, OrgPolicyTransport
53+
from .transports.grpc_asyncio import OrgPolicyGrpcAsyncIOTransport
5454

5555

5656
class OrgPolicyAsyncClient:

google/cloud/orgpolicy_v2/services/org_policy/client.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import os
1818
import re
1919
from typing import (
20-
Dict,
2120
Callable,
21+
Dict,
2222
Mapping,
2323
MutableMapping,
2424
MutableSequence,
@@ -31,28 +31,29 @@
3131
)
3232
import warnings
3333

34-
from google.cloud.orgpolicy_v2 import gapic_version as package_version
35-
3634
from google.api_core import client_options as client_options_lib
3735
from google.api_core import exceptions as core_exceptions
3836
from google.api_core import gapic_v1
3937
from google.api_core import retry as retries
4038
from google.auth import credentials as ga_credentials # type: ignore
39+
from google.auth.exceptions import MutualTLSChannelError # type: ignore
4140
from google.auth.transport import mtls # type: ignore
4241
from google.auth.transport.grpc import SslCredentials # type: ignore
43-
from google.auth.exceptions import MutualTLSChannelError # type: ignore
4442
from google.oauth2 import service_account # type: ignore
4543

44+
from google.cloud.orgpolicy_v2 import gapic_version as package_version
45+
4646
try:
4747
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
4848
except AttributeError: # pragma: NO COVER
4949
OptionalRetry = Union[retries.Retry, object, None] # type: ignore
5050

51-
from google.cloud.orgpolicy_v2.services.org_policy import pagers
52-
from google.cloud.orgpolicy_v2.types import constraint
53-
from google.cloud.orgpolicy_v2.types import orgpolicy
5451
from google.protobuf import timestamp_pb2 # type: ignore
55-
from .transports.base import OrgPolicyTransport, DEFAULT_CLIENT_INFO
52+
53+
from google.cloud.orgpolicy_v2.services.org_policy import pagers
54+
from google.cloud.orgpolicy_v2.types import constraint, orgpolicy
55+
56+
from .transports.base import DEFAULT_CLIENT_INFO, OrgPolicyTransport
5657
from .transports.grpc import OrgPolicyGrpcTransport
5758
from .transports.grpc_asyncio import OrgPolicyGrpcAsyncIOTransport
5859
from .transports.rest import OrgPolicyRestTransport

google/cloud/orgpolicy_v2/services/org_policy/pagers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
AsyncIterator,
1919
Awaitable,
2020
Callable,
21+
Iterator,
22+
Optional,
2123
Sequence,
2224
Tuple,
23-
Optional,
24-
Iterator,
2525
)
2626

27-
from google.cloud.orgpolicy_v2.types import constraint
28-
from google.cloud.orgpolicy_v2.types import orgpolicy
27+
from google.cloud.orgpolicy_v2.types import constraint, orgpolicy
2928

3029

3130
class ListConstraintsPager:

google/cloud/orgpolicy_v2/services/org_policy/transports/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@
1919
from .base import OrgPolicyTransport
2020
from .grpc import OrgPolicyGrpcTransport
2121
from .grpc_asyncio import OrgPolicyGrpcAsyncIOTransport
22-
from .rest import OrgPolicyRestTransport
23-
from .rest import OrgPolicyRestInterceptor
24-
22+
from .rest import OrgPolicyRestInterceptor, OrgPolicyRestTransport
2523

2624
# Compile a registry of transports.
2725
_transport_registry = OrderedDict() # type: Dict[str, Type[OrgPolicyTransport]]

0 commit comments

Comments
 (0)