diff --git a/google/cloud/securitycenter_v1/services/security_center/async_client.py b/google/cloud/securitycenter_v1/services/security_center/async_client.py index 644bdf4c..29a79228 100644 --- a/google/cloud/securitycenter_v1/services/security_center/async_client.py +++ b/google/cloud/securitycenter_v1/services/security_center/async_client.py @@ -48,7 +48,7 @@ from google.cloud.securitycenter_v1.types import source from google.cloud.securitycenter_v1.types import source as gcs_source 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 gi_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 @@ -585,7 +585,7 @@ async def get_iam_policy( retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), - ) -> policy.Policy: + ) -> gi_policy.Policy: r"""Gets the access control policy on the specified Source. @@ -1688,7 +1688,7 @@ async def set_iam_policy( retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), - ) -> policy.Policy: + ) -> gi_policy.Policy: r"""Sets the access control policy on the specified Source. diff --git a/google/cloud/securitycenter_v1/services/security_center/client.py b/google/cloud/securitycenter_v1/services/security_center/client.py index 5e85db59..ef4f7e88 100644 --- a/google/cloud/securitycenter_v1/services/security_center/client.py +++ b/google/cloud/securitycenter_v1/services/security_center/client.py @@ -52,7 +52,7 @@ from google.cloud.securitycenter_v1.types import source from google.cloud.securitycenter_v1.types import source as gcs_source 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 gi_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 @@ -837,7 +837,7 @@ def get_iam_policy( retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), - ) -> policy.Policy: + ) -> gi_policy.Policy: r"""Gets the access control policy on the specified Source. @@ -1868,7 +1868,7 @@ def set_iam_policy( retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), - ) -> policy.Policy: + ) -> gi_policy.Policy: r"""Sets the access control policy on the specified Source. diff --git a/google/cloud/securitycenter_v1/services/security_center/transports/base.py b/google/cloud/securitycenter_v1/services/security_center/transports/base.py index 82541447..3433745e 100644 --- a/google/cloud/securitycenter_v1/services/security_center/transports/base.py +++ b/google/cloud/securitycenter_v1/services/security_center/transports/base.py @@ -41,7 +41,7 @@ from google.cloud.securitycenter_v1.types import source from google.cloud.securitycenter_v1.types import source as gcs_source 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 gi_policy # type: ignore from google.longrunning import operations_pb2 as operations # type: ignore from google.protobuf import empty_pb2 as empty # type: ignore @@ -375,7 +375,7 @@ def get_iam_policy( self, ) -> typing.Callable[ [iam_policy.GetIamPolicyRequest], - typing.Union[policy.Policy, typing.Awaitable[policy.Policy]], + typing.Union[gi_policy.Policy, typing.Awaitable[gi_policy.Policy]], ]: raise NotImplementedError() @@ -507,7 +507,7 @@ def set_iam_policy( self, ) -> typing.Callable[ [iam_policy.SetIamPolicyRequest], - typing.Union[policy.Policy, typing.Awaitable[policy.Policy]], + typing.Union[gi_policy.Policy, typing.Awaitable[gi_policy.Policy]], ]: raise NotImplementedError() diff --git a/google/cloud/securitycenter_v1/services/security_center/transports/grpc.py b/google/cloud/securitycenter_v1/services/security_center/transports/grpc.py index 59612c98..5ecce6d8 100644 --- a/google/cloud/securitycenter_v1/services/security_center/transports/grpc.py +++ b/google/cloud/securitycenter_v1/services/security_center/transports/grpc.py @@ -42,7 +42,7 @@ from google.cloud.securitycenter_v1.types import source from google.cloud.securitycenter_v1.types import source as gcs_source 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 gi_policy # type: ignore from google.longrunning import operations_pb2 as operations # type: ignore from google.protobuf import empty_pb2 as empty # type: ignore @@ -367,7 +367,7 @@ def delete_notification_config( @property def get_iam_policy( self, - ) -> Callable[[iam_policy.GetIamPolicyRequest], policy.Policy]: + ) -> Callable[[iam_policy.GetIamPolicyRequest], gi_policy.Policy]: r"""Return a callable for the get iam policy method over gRPC. Gets the access control policy on the specified @@ -387,7 +387,7 @@ def get_iam_policy( self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1.SecurityCenter/GetIamPolicy", request_serializer=iam_policy.GetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=gi_policy.Policy.FromString, ) return self._stubs["get_iam_policy"] @@ -719,7 +719,7 @@ def set_finding_state( @property def set_iam_policy( self, - ) -> Callable[[iam_policy.SetIamPolicyRequest], policy.Policy]: + ) -> Callable[[iam_policy.SetIamPolicyRequest], gi_policy.Policy]: r"""Return a callable for the set iam policy method over gRPC. Sets the access control policy on the specified @@ -739,7 +739,7 @@ def set_iam_policy( self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1.SecurityCenter/SetIamPolicy", request_serializer=iam_policy.SetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=gi_policy.Policy.FromString, ) return self._stubs["set_iam_policy"] diff --git a/google/cloud/securitycenter_v1/services/security_center/transports/grpc_asyncio.py b/google/cloud/securitycenter_v1/services/security_center/transports/grpc_asyncio.py index 8c4e9bef..0b83990e 100644 --- a/google/cloud/securitycenter_v1/services/security_center/transports/grpc_asyncio.py +++ b/google/cloud/securitycenter_v1/services/security_center/transports/grpc_asyncio.py @@ -43,7 +43,7 @@ from google.cloud.securitycenter_v1.types import source from google.cloud.securitycenter_v1.types import source as gcs_source 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 gi_policy # type: ignore from google.longrunning import operations_pb2 as operations # type: ignore from google.protobuf import empty_pb2 as empty # type: ignore @@ -377,7 +377,7 @@ def delete_notification_config( @property def get_iam_policy( self, - ) -> Callable[[iam_policy.GetIamPolicyRequest], Awaitable[policy.Policy]]: + ) -> Callable[[iam_policy.GetIamPolicyRequest], Awaitable[gi_policy.Policy]]: r"""Return a callable for the get iam policy method over gRPC. Gets the access control policy on the specified @@ -397,7 +397,7 @@ def get_iam_policy( self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1.SecurityCenter/GetIamPolicy", request_serializer=iam_policy.GetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=gi_policy.Policy.FromString, ) return self._stubs["get_iam_policy"] @@ -732,7 +732,7 @@ def set_finding_state( @property def set_iam_policy( self, - ) -> Callable[[iam_policy.SetIamPolicyRequest], Awaitable[policy.Policy]]: + ) -> Callable[[iam_policy.SetIamPolicyRequest], Awaitable[gi_policy.Policy]]: r"""Return a callable for the set iam policy method over gRPC. Sets the access control policy on the specified @@ -752,7 +752,7 @@ def set_iam_policy( self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1.SecurityCenter/SetIamPolicy", request_serializer=iam_policy.SetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=gi_policy.Policy.FromString, ) return self._stubs["set_iam_policy"] diff --git a/google/cloud/securitycenter_v1beta1/services/security_center/async_client.py b/google/cloud/securitycenter_v1beta1/services/security_center/async_client.py index 14c5d94f..9e94dc56 100644 --- a/google/cloud/securitycenter_v1beta1/services/security_center/async_client.py +++ b/google/cloud/securitycenter_v1beta1/services/security_center/async_client.py @@ -45,7 +45,7 @@ from google.cloud.securitycenter_v1beta1.types import source from google.cloud.securitycenter_v1beta1.types import source as gcs_source 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 timestamp_pb2 as timestamp # type: ignore @@ -403,7 +403,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 access control policy on the specified Source. @@ -1333,7 +1333,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"""Sets the access control policy on the specified Source. diff --git a/google/cloud/securitycenter_v1beta1/services/security_center/client.py b/google/cloud/securitycenter_v1beta1/services/security_center/client.py index 73dd2f2a..0886d921 100644 --- a/google/cloud/securitycenter_v1beta1/services/security_center/client.py +++ b/google/cloud/securitycenter_v1beta1/services/security_center/client.py @@ -49,7 +49,7 @@ from google.cloud.securitycenter_v1beta1.types import source from google.cloud.securitycenter_v1beta1.types import source as gcs_source 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 timestamp_pb2 as timestamp # type: ignore @@ -626,7 +626,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 access control policy on the specified Source. @@ -1496,7 +1496,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"""Sets the access control policy on the specified Source. diff --git a/google/cloud/securitycenter_v1beta1/services/security_center/transports/base.py b/google/cloud/securitycenter_v1beta1/services/security_center/transports/base.py index 3a22dfc9..d076339c 100644 --- a/google/cloud/securitycenter_v1beta1/services/security_center/transports/base.py +++ b/google/cloud/securitycenter_v1beta1/services/security_center/transports/base.py @@ -39,7 +39,7 @@ from google.cloud.securitycenter_v1beta1.types import source from google.cloud.securitycenter_v1beta1.types import source as gcs_source 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 @@ -308,7 +308,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() @@ -416,7 +416,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() diff --git a/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc.py b/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc.py index 2bcfb198..3c87dcc1 100644 --- a/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc.py +++ b/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc.py @@ -40,7 +40,7 @@ from google.cloud.securitycenter_v1beta1.types import source from google.cloud.securitycenter_v1beta1.types import source as gcs_source 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 .base import SecurityCenterTransport, DEFAULT_CLIENT_INFO @@ -307,7 +307,7 @@ def create_finding( @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 access control policy on the specified @@ -327,7 +327,7 @@ def get_iam_policy( self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1beta1.SecurityCenter/GetIamPolicy", request_serializer=iam_policy.GetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["get_iam_policy"] @@ -603,7 +603,7 @@ def set_finding_state( @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. Sets the access control policy on the specified @@ -623,7 +623,7 @@ def set_iam_policy( self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1beta1.SecurityCenter/SetIamPolicy", request_serializer=iam_policy.SetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["set_iam_policy"] diff --git a/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc_asyncio.py b/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc_asyncio.py index f401d887..0b86de0c 100644 --- a/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc_asyncio.py +++ b/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc_asyncio.py @@ -41,7 +41,7 @@ from google.cloud.securitycenter_v1beta1.types import source from google.cloud.securitycenter_v1beta1.types import source as gcs_source 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 .base import SecurityCenterTransport, DEFAULT_CLIENT_INFO @@ -317,7 +317,7 @@ def create_finding( @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 access control policy on the specified @@ -337,7 +337,7 @@ def get_iam_policy( self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1beta1.SecurityCenter/GetIamPolicy", request_serializer=iam_policy.GetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["get_iam_policy"] @@ -616,7 +616,7 @@ def set_finding_state( @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. Sets the access control policy on the specified @@ -636,7 +636,7 @@ def set_iam_policy( self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1beta1.SecurityCenter/SetIamPolicy", request_serializer=iam_policy.SetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["set_iam_policy"] diff --git a/google/cloud/securitycenter_v1p1beta1/services/security_center/async_client.py b/google/cloud/securitycenter_v1p1beta1/services/security_center/async_client.py index ac8719ec..f9ec24f7 100644 --- a/google/cloud/securitycenter_v1p1beta1/services/security_center/async_client.py +++ b/google/cloud/securitycenter_v1p1beta1/services/security_center/async_client.py @@ -50,7 +50,7 @@ from google.cloud.securitycenter_v1p1beta1.types import source from google.cloud.securitycenter_v1p1beta1.types import source as gcs_source 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 @@ -584,7 +584,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 access control policy on the specified Source. @@ -1737,7 +1737,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"""Sets the access control policy on the specified Source. diff --git a/google/cloud/securitycenter_v1p1beta1/services/security_center/client.py b/google/cloud/securitycenter_v1p1beta1/services/security_center/client.py index bbee6898..9df7090d 100644 --- a/google/cloud/securitycenter_v1p1beta1/services/security_center/client.py +++ b/google/cloud/securitycenter_v1p1beta1/services/security_center/client.py @@ -54,7 +54,7 @@ from google.cloud.securitycenter_v1p1beta1.types import source from google.cloud.securitycenter_v1p1beta1.types import source as gcs_source 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 @@ -836,7 +836,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 access control policy on the specified Source. @@ -1917,7 +1917,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"""Sets the access control policy on the specified Source. diff --git a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/base.py b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/base.py index fddc88f5..4e0c9e77 100644 --- a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/base.py +++ b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/base.py @@ -43,7 +43,7 @@ from google.cloud.securitycenter_v1p1beta1.types import source from google.cloud.securitycenter_v1p1beta1.types import source as gcs_source 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 @@ -377,7 +377,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() @@ -509,7 +509,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() diff --git a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc.py b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc.py index 15182889..26c0b455 100644 --- a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc.py +++ b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc.py @@ -44,7 +44,7 @@ from google.cloud.securitycenter_v1p1beta1.types import source from google.cloud.securitycenter_v1p1beta1.types import source as gcs_source 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 @@ -369,7 +369,7 @@ def delete_notification_config( @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 access control policy on the specified @@ -389,7 +389,7 @@ def get_iam_policy( self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1p1beta1.SecurityCenter/GetIamPolicy", request_serializer=iam_policy.GetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["get_iam_policy"] @@ -723,7 +723,7 @@ def set_finding_state( @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. Sets the access control policy on the specified @@ -743,7 +743,7 @@ def set_iam_policy( self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1p1beta1.SecurityCenter/SetIamPolicy", request_serializer=iam_policy.SetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["set_iam_policy"] diff --git a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc_asyncio.py b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc_asyncio.py index dfb65374..51442834 100644 --- a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc_asyncio.py +++ b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc_asyncio.py @@ -45,7 +45,7 @@ from google.cloud.securitycenter_v1p1beta1.types import source from google.cloud.securitycenter_v1p1beta1.types import source as gcs_source 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 @@ -379,7 +379,7 @@ def delete_notification_config( @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 access control policy on the specified @@ -399,7 +399,7 @@ def get_iam_policy( self._stubs["get_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1p1beta1.SecurityCenter/GetIamPolicy", request_serializer=iam_policy.GetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["get_iam_policy"] @@ -736,7 +736,7 @@ def set_finding_state( @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. Sets the access control policy on the specified @@ -756,7 +756,7 @@ def set_iam_policy( self._stubs["set_iam_policy"] = self.grpc_channel.unary_unary( "/google.cloud.securitycenter.v1p1beta1.SecurityCenter/SetIamPolicy", request_serializer=iam_policy.SetIamPolicyRequest.SerializeToString, - response_deserializer=policy.Policy.FromString, + response_deserializer=giv_policy.Policy.FromString, ) return self._stubs["set_iam_policy"] diff --git a/scripts/fixup_securitycenter_v1_keywords.py b/scripts/fixup_securitycenter_v1_keywords.py index 6afbe367..4e595250 100644 --- a/scripts/fixup_securitycenter_v1_keywords.py +++ b/scripts/fixup_securitycenter_v1_keywords.py @@ -45,7 +45,7 @@ class securitycenterCallTransformer(cst.CSTTransformer): 'create_notification_config': ('parent', 'config_id', 'notification_config', ), 'create_source': ('parent', 'source', ), 'delete_notification_config': ('name', ), - 'get_iam_policy': ('resource', 'options', ), + 'get_iam_policy': ('resource', 'options_', ), 'get_notification_config': ('name', ), 'get_organization_settings': ('name', ), 'get_source': ('name', ), @@ -57,7 +57,7 @@ class securitycenterCallTransformer(cst.CSTTransformer): 'list_sources': ('parent', 'page_token', 'page_size', ), 'run_asset_discovery': ('parent', ), 'set_finding_state': ('name', 'state', 'start_time', ), - 'set_iam_policy': ('resource', 'policy', ), + 'set_iam_policy': ('resource', 'policy_', ), 'test_iam_permissions': ('resource', 'permissions', ), 'update_finding': ('finding', 'update_mask', ), 'update_notification_config': ('notification_config', 'update_mask', ), diff --git a/scripts/fixup_securitycenter_v1beta1_keywords.py b/scripts/fixup_securitycenter_v1beta1_keywords.py index c2bdd2db..6dbfd0bf 100644 --- a/scripts/fixup_securitycenter_v1beta1_keywords.py +++ b/scripts/fixup_securitycenter_v1beta1_keywords.py @@ -43,7 +43,7 @@ class securitycenterCallTransformer(cst.CSTTransformer): METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { 'create_finding': ('parent', 'finding_id', 'finding', ), 'create_source': ('parent', 'source', ), - 'get_iam_policy': ('resource', 'options', ), + 'get_iam_policy': ('resource', 'options_', ), 'get_organization_settings': ('name', ), 'get_source': ('name', ), 'group_assets': ('parent', 'group_by', 'filter', 'compare_duration', 'read_time', 'page_token', 'page_size', ), @@ -53,7 +53,7 @@ class securitycenterCallTransformer(cst.CSTTransformer): 'list_sources': ('parent', 'page_token', 'page_size', ), 'run_asset_discovery': ('parent', ), 'set_finding_state': ('name', 'state', 'start_time', ), - 'set_iam_policy': ('resource', 'policy', ), + 'set_iam_policy': ('resource', 'policy_', ), 'test_iam_permissions': ('resource', 'permissions', ), 'update_finding': ('finding', 'update_mask', ), 'update_organization_settings': ('organization_settings', 'update_mask', ), diff --git a/scripts/fixup_securitycenter_v1p1beta1_keywords.py b/scripts/fixup_securitycenter_v1p1beta1_keywords.py index 6afbe367..4e595250 100644 --- a/scripts/fixup_securitycenter_v1p1beta1_keywords.py +++ b/scripts/fixup_securitycenter_v1p1beta1_keywords.py @@ -45,7 +45,7 @@ class securitycenterCallTransformer(cst.CSTTransformer): 'create_notification_config': ('parent', 'config_id', 'notification_config', ), 'create_source': ('parent', 'source', ), 'delete_notification_config': ('name', ), - 'get_iam_policy': ('resource', 'options', ), + 'get_iam_policy': ('resource', 'options_', ), 'get_notification_config': ('name', ), 'get_organization_settings': ('name', ), 'get_source': ('name', ), @@ -57,7 +57,7 @@ class securitycenterCallTransformer(cst.CSTTransformer): 'list_sources': ('parent', 'page_token', 'page_size', ), 'run_asset_discovery': ('parent', ), 'set_finding_state': ('name', 'state', 'start_time', ), - 'set_iam_policy': ('resource', 'policy', ), + 'set_iam_policy': ('resource', 'policy_', ), 'test_iam_permissions': ('resource', 'permissions', ), 'update_finding': ('finding', 'update_mask', ), 'update_notification_config': ('notification_config', 'update_mask', ), diff --git a/synth.metadata b/synth.metadata index 96c39c4c..c94ff762 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-securitycenter.git", - "sha": "15c28e88f5b52a6e4f608198446b0753bf48734e" + "sha": "008945b45fbce762e7e878e20b403d3f9ddfe602" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "7c8d16188e68347aac0053a40ab1dc2056a44899", - "internalRef": "365829960" + "sha": "2490be32f08cccc870862ea86920f58325795c89", + "internalRef": "366826395" } }, { diff --git a/tests/unit/gapic/securitycenter_v1/test_security_center.py b/tests/unit/gapic/securitycenter_v1/test_security_center.py index ae141baa..5bfc6f5d 100644 --- a/tests/unit/gapic/securitycenter_v1/test_security_center.py +++ b/tests/unit/gapic/securitycenter_v1/test_security_center.py @@ -58,8 +58,8 @@ from google.cloud.securitycenter_v1.types import source from google.cloud.securitycenter_v1.types import source as gcs_source 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 gi_options # type: ignore +from google.iam.v1 import policy_pb2 as gi_policy # type: ignore from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import duration_pb2 as duration # type: ignore @@ -1481,7 +1481,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 = gi_policy.Policy(version=774, etag=b"etag_blob",) response = client.get_iam_policy(request) @@ -1493,7 +1493,7 @@ def test_get_iam_policy( # Establish that the response is the type that we expect. - assert isinstance(response, policy.Policy) + assert isinstance(response, gi_policy.Policy) assert response.version == 774 @@ -1536,7 +1536,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",) + gi_policy.Policy(version=774, etag=b"etag_blob",) ) response = await client.get_iam_policy(request) @@ -1548,7 +1548,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, gi_policy.Policy) assert response.version == 774 @@ -1570,7 +1570,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 = gi_policy.Policy() client.get_iam_policy(request) @@ -1595,7 +1595,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(gi_policy.Policy()) await client.get_iam_policy(request) @@ -1614,12 +1614,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 = gi_policy.Policy() response = client.get_iam_policy( request={ "resource": "resource_value", - "options": options.GetPolicyOptions(requested_policy_version=2598), + "options_": gi_options.GetPolicyOptions(requested_policy_version=2598), } ) call.assert_called() @@ -1631,7 +1631,7 @@ def test_get_iam_policy_flattened(): # 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 = gi_policy.Policy() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. @@ -1663,9 +1663,9 @@ async def test_get_iam_policy_flattened_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: # Designate an appropriate return value for the call. - call.return_value = policy.Policy() + call.return_value = gi_policy.Policy() - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(gi_policy.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.get_iam_policy(resource="resource_value",) @@ -5005,7 +5005,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 = gi_policy.Policy(version=774, etag=b"etag_blob",) response = client.set_iam_policy(request) @@ -5017,7 +5017,7 @@ def test_set_iam_policy( # Establish that the response is the type that we expect. - assert isinstance(response, policy.Policy) + assert isinstance(response, gi_policy.Policy) assert response.version == 774 @@ -5060,7 +5060,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",) + gi_policy.Policy(version=774, etag=b"etag_blob",) ) response = await client.set_iam_policy(request) @@ -5072,7 +5072,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, gi_policy.Policy) assert response.version == 774 @@ -5094,7 +5094,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 = gi_policy.Policy() client.set_iam_policy(request) @@ -5119,7 +5119,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(gi_policy.Policy()) await client.set_iam_policy(request) @@ -5138,12 +5138,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 = gi_policy.Policy() response = client.set_iam_policy( request={ "resource": "resource_value", - "policy": policy.Policy(version=774), + "policy_": gi_policy.Policy(version=774), } ) call.assert_called() @@ -5155,7 +5155,7 @@ def test_set_iam_policy_flattened(): # 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 = gi_policy.Policy() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. @@ -5187,9 +5187,9 @@ async def test_set_iam_policy_flattened_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: # Designate an appropriate return value for the call. - call.return_value = policy.Policy() + call.return_value = gi_policy.Policy() - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(gi_policy.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.set_iam_policy(resource="resource_value",) diff --git a/tests/unit/gapic/securitycenter_v1beta1/test_security_center.py b/tests/unit/gapic/securitycenter_v1beta1/test_security_center.py index bc4bb9a2..52ac5b0f 100644 --- a/tests/unit/gapic/securitycenter_v1beta1/test_security_center.py +++ b/tests/unit/gapic/securitycenter_v1beta1/test_security_center.py @@ -57,8 +57,8 @@ from google.cloud.securitycenter_v1beta1.types import source from google.cloud.securitycenter_v1beta1.types import source as gcs_source 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 duration_pb2 as duration # type: ignore @@ -976,7 +976,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) @@ -988,7 +988,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 @@ -1031,7 +1031,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) @@ -1043,7 +1043,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 @@ -1065,7 +1065,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) @@ -1090,7 +1090,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) @@ -1109,12 +1109,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() @@ -1126,7 +1126,7 @@ def test_get_iam_policy_flattened(): # 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() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. @@ -1158,9 +1158,9 @@ async def test_get_iam_policy_flattened_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: # Designate an appropriate return value for the call. - call.return_value = policy.Policy() + call.return_value = giv_policy.Policy() - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(giv_policy.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.get_iam_policy(resource="resource_value",) @@ -3785,7 +3785,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) @@ -3797,7 +3797,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 @@ -3840,7 +3840,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) @@ -3852,7 +3852,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 @@ -3874,7 +3874,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) @@ -3899,7 +3899,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) @@ -3918,12 +3918,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() @@ -3935,7 +3935,7 @@ def test_set_iam_policy_flattened(): # 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() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. @@ -3967,9 +3967,9 @@ async def test_set_iam_policy_flattened_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: # Designate an appropriate return value for the call. - call.return_value = policy.Policy() + call.return_value = giv_policy.Policy() - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(giv_policy.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.set_iam_policy(resource="resource_value",) diff --git a/tests/unit/gapic/securitycenter_v1p1beta1/test_security_center.py b/tests/unit/gapic/securitycenter_v1p1beta1/test_security_center.py index 4e7ebe8b..f42675e3 100644 --- a/tests/unit/gapic/securitycenter_v1p1beta1/test_security_center.py +++ b/tests/unit/gapic/securitycenter_v1p1beta1/test_security_center.py @@ -62,8 +62,8 @@ from google.cloud.securitycenter_v1p1beta1.types import source from google.cloud.securitycenter_v1p1beta1.types import source as gcs_source 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 duration_pb2 as duration # type: ignore @@ -1497,7 +1497,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) @@ -1509,7 +1509,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 @@ -1552,7 +1552,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) @@ -1564,7 +1564,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 @@ -1586,7 +1586,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) @@ -1611,7 +1611,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) @@ -1630,12 +1630,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() @@ -1647,7 +1647,7 @@ def test_get_iam_policy_flattened(): # 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() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. @@ -1679,9 +1679,9 @@ async def test_get_iam_policy_flattened_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: # Designate an appropriate return value for the call. - call.return_value = policy.Policy() + call.return_value = giv_policy.Policy() - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(giv_policy.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.get_iam_policy(resource="resource_value",) @@ -5165,7 +5165,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) @@ -5177,7 +5177,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 @@ -5220,7 +5220,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) @@ -5232,7 +5232,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 @@ -5254,7 +5254,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) @@ -5279,7 +5279,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) @@ -5298,12 +5298,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() @@ -5315,7 +5315,7 @@ def test_set_iam_policy_flattened(): # 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() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. @@ -5347,9 +5347,9 @@ async def test_set_iam_policy_flattened_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: # Designate an appropriate return value for the call. - call.return_value = policy.Policy() + call.return_value = giv_policy.Policy() - call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy.Policy()) + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(giv_policy.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.set_iam_policy(resource="resource_value",)