diff --git a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py index 7c3268a..953a848 100644 --- a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py +++ b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/async_client.py @@ -40,7 +40,7 @@ from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag from google.cloud.artifactregistry_v1beta2.types import version from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore -from google.iam.v1 import policy_pb2 as policy # type: ignore +from google.iam.v1 import policy_pb2 as giv_policy # type: ignore from google.protobuf import empty_pb2 as empty # type: ignore from google.protobuf import field_mask_pb2 as field_mask # type: ignore from google.protobuf import timestamp_pb2 as timestamp # type: ignore @@ -1771,7 +1771,7 @@ async def set_iam_policy( retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), - ) -> policy.Policy: + ) -> giv_policy.Policy: r"""Updates the IAM policy for a given resource. Args: @@ -1878,7 +1878,7 @@ async def get_iam_policy( retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), - ) -> policy.Policy: + ) -> giv_policy.Policy: r"""Gets the IAM policy for a given resource. Args: diff --git a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/client.py b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/client.py index f66b40e..fcb263f 100644 --- a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/client.py +++ b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/client.py @@ -44,7 +44,7 @@ from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag from google.cloud.artifactregistry_v1beta2.types import version from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore -from google.iam.v1 import policy_pb2 as policy # type: ignore +from google.iam.v1 import policy_pb2 as giv_policy # type: ignore from google.protobuf import empty_pb2 as empty # type: ignore from google.protobuf import field_mask_pb2 as field_mask # type: ignore from google.protobuf import timestamp_pb2 as timestamp # type: ignore @@ -1879,7 +1879,7 @@ def set_iam_policy( retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), - ) -> policy.Policy: + ) -> giv_policy.Policy: r"""Updates the IAM policy for a given resource. Args: @@ -1985,7 +1985,7 @@ def get_iam_policy( retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), - ) -> policy.Policy: + ) -> giv_policy.Policy: r"""Gets the IAM policy for a given resource. Args: diff --git a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/base.py b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/base.py index 9af99f8..08bb048 100644 --- a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/base.py +++ b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/base.py @@ -34,7 +34,7 @@ from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag from google.cloud.artifactregistry_v1beta2.types import version from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore -from google.iam.v1 import policy_pb2 as policy # type: ignore +from google.iam.v1 import policy_pb2 as giv_policy # type: ignore from google.longrunning import operations_pb2 as operations # type: ignore from google.protobuf import empty_pb2 as empty # type: ignore @@ -500,7 +500,7 @@ def set_iam_policy( self, ) -> typing.Callable[ [iam_policy.SetIamPolicyRequest], - typing.Union[policy.Policy, typing.Awaitable[policy.Policy]], + typing.Union[giv_policy.Policy, typing.Awaitable[giv_policy.Policy]], ]: raise NotImplementedError() @@ -509,7 +509,7 @@ def get_iam_policy( self, ) -> typing.Callable[ [iam_policy.GetIamPolicyRequest], - typing.Union[policy.Policy, typing.Awaitable[policy.Policy]], + typing.Union[giv_policy.Policy, typing.Awaitable[giv_policy.Policy]], ]: raise NotImplementedError() diff --git a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/grpc.py b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/grpc.py index 4db68b4..987afed 100644 --- a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/grpc.py +++ b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/grpc.py @@ -35,7 +35,7 @@ from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag from google.cloud.artifactregistry_v1beta2.types import version from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore -from google.iam.v1 import policy_pb2 as policy # type: ignore +from google.iam.v1 import policy_pb2 as giv_policy # type: ignore from google.longrunning import operations_pb2 as operations # type: ignore from google.protobuf import empty_pb2 as empty # type: ignore @@ -723,7 +723,7 @@ def delete_tag(self) -> Callable[[tag.DeleteTagRequest], empty.Empty]: @property def set_iam_policy( self, - ) -> Callable[[iam_policy.SetIamPolicyRequest], policy.Policy]: + ) -> Callable[[iam_policy.SetIamPolicyRequest], giv_policy.Policy]: r"""Return a callable for the set iam policy method over gRPC. Updates the IAM policy for a given resource. @@ -742,14 +742,14 @@ def set_iam_policy( self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( "/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/SetIamPolicy", request_serializer=iam_policy.SetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["set_iam_policy"] @property def get_iam_policy( self, - ) -> Callable[[iam_policy.GetIamPolicyRequest], policy.Policy]: + ) -> Callable[[iam_policy.GetIamPolicyRequest], giv_policy.Policy]: r"""Return a callable for the get iam policy method over gRPC. Gets the IAM policy for a given resource. @@ -768,7 +768,7 @@ def get_iam_policy( self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( "/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetIamPolicy", request_serializer=iam_policy.GetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["get_iam_policy"] diff --git a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/grpc_asyncio.py b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/grpc_asyncio.py index 290f4f6..a13f0b0 100644 --- a/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/grpc_asyncio.py +++ b/google/cloud/artifactregistry_v1beta2/services/artifact_registry/transports/grpc_asyncio.py @@ -36,7 +36,7 @@ from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag from google.cloud.artifactregistry_v1beta2.types import version from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore -from google.iam.v1 import policy_pb2 as policy # type: ignore +from google.iam.v1 import policy_pb2 as giv_policy # type: ignore from google.longrunning import operations_pb2 as operations # type: ignore from google.protobuf import empty_pb2 as empty # type: ignore @@ -752,7 +752,7 @@ def delete_tag(self) -> Callable[[tag.DeleteTagRequest], Awaitable[empty.Empty]] @property def set_iam_policy( self, - ) -> Callable[[iam_policy.SetIamPolicyRequest], Awaitable[policy.Policy]]: + ) -> Callable[[iam_policy.SetIamPolicyRequest], Awaitable[giv_policy.Policy]]: r"""Return a callable for the set iam policy method over gRPC. Updates the IAM policy for a given resource. @@ -771,14 +771,14 @@ def set_iam_policy( self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( "/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/SetIamPolicy", request_serializer=iam_policy.SetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["set_iam_policy"] @property def get_iam_policy( self, - ) -> Callable[[iam_policy.GetIamPolicyRequest], Awaitable[policy.Policy]]: + ) -> Callable[[iam_policy.GetIamPolicyRequest], Awaitable[giv_policy.Policy]]: r"""Return a callable for the get iam policy method over gRPC. Gets the IAM policy for a given resource. @@ -797,7 +797,7 @@ def get_iam_policy( self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( "/google.devtools.artifactregistry.v1beta2.ArtifactRegistry/GetIamPolicy", request_serializer=iam_policy.GetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["get_iam_policy"] diff --git a/scripts/fixup_artifactregistry_v1beta2_keywords.py b/scripts/fixup_artifactregistry_v1beta2_keywords.py index 69ca108..32dc706 100644 --- a/scripts/fixup_artifactregistry_v1beta2_keywords.py +++ b/scripts/fixup_artifactregistry_v1beta2_keywords.py @@ -48,7 +48,7 @@ class artifactregistryCallTransformer(cst.CSTTransformer): 'delete_tag': ('name', ), 'delete_version': ('name', 'force', ), 'get_file': ('name', ), - 'get_iam_policy': ('resource', 'options', ), + 'get_iam_policy': ('resource', 'options_', ), 'get_package': ('name', ), 'get_repository': ('name', ), 'get_tag': ('name', ), @@ -58,7 +58,7 @@ class artifactregistryCallTransformer(cst.CSTTransformer): 'list_repositories': ('parent', 'page_size', 'page_token', ), 'list_tags': ('parent', 'filter', 'page_size', 'page_token', ), 'list_versions': ('parent', 'page_size', 'page_token', 'view', ), - 'set_iam_policy': ('resource', 'policy', ), + 'set_iam_policy': ('resource', 'policy_', ), 'test_iam_permissions': ('resource', 'permissions', ), 'update_repository': ('repository', 'update_mask', ), 'update_tag': ('tag', 'update_mask', ), diff --git a/synth.metadata b/synth.metadata index 7fe83d0..4fa285e 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,8 +11,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6598bb829c9e9a534be674649ffd1b4671a821f9", - "internalRef": "364449524" + "sha": "2490be32f08cccc870862ea86920f58325795c89", + "internalRef": "366826395" } }, { diff --git a/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py b/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py index 11d60a6..6a32870 100644 --- a/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py +++ b/tests/unit/gapic/artifactregistry_v1beta2/test_artifact_registry.py @@ -52,8 +52,8 @@ from google.cloud.artifactregistry_v1beta2.types import tag as gda_tag from google.cloud.artifactregistry_v1beta2.types import version from google.iam.v1 import iam_policy_pb2 as iam_policy # type: ignore -from google.iam.v1 import options_pb2 as options # type: ignore -from google.iam.v1 import policy_pb2 as policy # type: ignore +from google.iam.v1 import options_pb2 as giv_options # type: ignore +from google.iam.v1 import policy_pb2 as giv_policy # type: ignore from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import field_mask_pb2 as field_mask # type: ignore @@ -5073,7 +5073,7 @@ def test_set_iam_policy( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy.Policy(version=774, etag=b"etag_blob",) + call.return_value = giv_policy.Policy(version=774, etag=b"etag_blob",) response = client.set_iam_policy(request) @@ -5085,7 +5085,7 @@ def test_set_iam_policy( # Establish that the response is the type that we expect. - assert isinstance(response, policy.Policy) + assert isinstance(response, giv_policy.Policy) assert response.version == 774 @@ -5128,7 +5128,7 @@ async def test_set_iam_policy_async( with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy.Policy(version=774, etag=b"etag_blob",) + giv_policy.Policy(version=774, etag=b"etag_blob",) ) response = await client.set_iam_policy(request) @@ -5140,7 +5140,7 @@ async def test_set_iam_policy_async( assert args[0] == iam_policy.SetIamPolicyRequest() # Establish that the response is the type that we expect. - assert isinstance(response, policy.Policy) + assert isinstance(response, giv_policy.Policy) assert response.version == 774 @@ -5162,7 +5162,7 @@ def test_set_iam_policy_field_headers(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: - call.return_value = policy.Policy() + call.return_value = giv_policy.Policy() client.set_iam_policy(request) @@ -5189,7 +5189,7 @@ async def test_set_iam_policy_field_headers_async(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(giv_policy.Policy()) await client.set_iam_policy(request) @@ -5208,12 +5208,12 @@ def test_set_iam_policy_from_dict_foreign(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy.Policy() + call.return_value = giv_policy.Policy() response = client.set_iam_policy( request={ "resource": "resource_value", - "policy": policy.Policy(version=774), + "policy_": giv_policy.Policy(version=774), } ) call.assert_called() @@ -5233,7 +5233,7 @@ def test_get_iam_policy( # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy.Policy(version=774, etag=b"etag_blob",) + call.return_value = giv_policy.Policy(version=774, etag=b"etag_blob",) response = client.get_iam_policy(request) @@ -5245,7 +5245,7 @@ def test_get_iam_policy( # Establish that the response is the type that we expect. - assert isinstance(response, policy.Policy) + assert isinstance(response, giv_policy.Policy) assert response.version == 774 @@ -5288,7 +5288,7 @@ async def test_get_iam_policy_async( with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy.Policy(version=774, etag=b"etag_blob",) + giv_policy.Policy(version=774, etag=b"etag_blob",) ) response = await client.get_iam_policy(request) @@ -5300,7 +5300,7 @@ async def test_get_iam_policy_async( assert args[0] == iam_policy.GetIamPolicyRequest() # Establish that the response is the type that we expect. - assert isinstance(response, policy.Policy) + assert isinstance(response, giv_policy.Policy) assert response.version == 774 @@ -5322,7 +5322,7 @@ def test_get_iam_policy_field_headers(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: - call.return_value = policy.Policy() + call.return_value = giv_policy.Policy() client.get_iam_policy(request) @@ -5349,7 +5349,7 @@ async def test_get_iam_policy_field_headers_async(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(giv_policy.Policy()) await client.get_iam_policy(request) @@ -5368,12 +5368,12 @@ def test_get_iam_policy_from_dict_foreign(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy.Policy() + call.return_value = giv_policy.Policy() response = client.get_iam_policy( request={ "resource": "resource_value", - "options": options.GetPolicyOptions(requested_policy_version=2598), + "options_": giv_options.GetPolicyOptions(requested_policy_version=2598), } ) call.assert_called()