diff --git a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py index 8876be6..c8c2474 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py +++ b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/async_client.py @@ -299,7 +299,7 @@ async def update_policy( self, request: service.UpdatePolicyRequest = None, *, - policy: resources.Policy = None, + policy_: resources.Policy = None, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), @@ -317,7 +317,7 @@ async def update_policy( request (:class:`google.cloud.binaryauthorization_v1beta1.types.UpdatePolicyRequest`): The request object. Request message for [BinauthzManagementService.UpdatePolicy][]. - policy (:class:`google.cloud.binaryauthorization_v1beta1.types.Policy`): + policy_ (:class:`google.cloud.binaryauthorization_v1beta1.types.Policy`): Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will overwrite the [policy @@ -325,7 +325,7 @@ async def update_policy( field with the resource name in the request URL, in the format ``projects/*/policy``. - This corresponds to the ``policy`` field + This corresponds to the ``policy_`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -344,7 +344,7 @@ async def update_policy( # Create or coerce a protobuf request object. # Sanity check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. - has_flattened_params = any([policy]) + has_flattened_params = any([policy_]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " @@ -356,8 +356,8 @@ async def update_policy( # If we have keyword arguments corresponding to fields on the # request, apply these. - if policy is not None: - request.policy = policy + if policy_ is not None: + request.policy_ = policy_ # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. diff --git a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py index aac65a5..4dbbd25 100644 --- a/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py +++ b/google/cloud/binaryauthorization_v1beta1/services/binauthz_management_service_v1_beta1/client.py @@ -464,7 +464,7 @@ def update_policy( self, request: service.UpdatePolicyRequest = None, *, - policy: resources.Policy = None, + policy_: resources.Policy = None, retry: retries.Retry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), @@ -482,7 +482,7 @@ def update_policy( request (google.cloud.binaryauthorization_v1beta1.types.UpdatePolicyRequest): The request object. Request message for [BinauthzManagementService.UpdatePolicy][]. - policy (google.cloud.binaryauthorization_v1beta1.types.Policy): + policy_ (google.cloud.binaryauthorization_v1beta1.types.Policy): Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will overwrite the [policy @@ -490,7 +490,7 @@ def update_policy( field with the resource name in the request URL, in the format ``projects/*/policy``. - This corresponds to the ``policy`` field + This corresponds to the ``policy_`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -509,7 +509,7 @@ def update_policy( # Create or coerce a protobuf request object. # Sanity check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. - has_flattened_params = any([policy]) + has_flattened_params = any([policy_]) if request is not None and has_flattened_params: raise ValueError( "If the `request` argument is set, then none of " @@ -526,8 +526,8 @@ def update_policy( # If we have keyword arguments corresponding to fields on the # request, apply these. - if policy is not None: - request.policy = policy + if policy_ is not None: + request.policy_ = policy_ # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. diff --git a/google/cloud/binaryauthorization_v1beta1/types/service.py b/google/cloud/binaryauthorization_v1beta1/types/service.py index d219341..c77d251 100644 --- a/google/cloud/binaryauthorization_v1beta1/types/service.py +++ b/google/cloud/binaryauthorization_v1beta1/types/service.py @@ -53,7 +53,7 @@ class UpdatePolicyRequest(proto.Message): r"""Request message for [BinauthzManagementService.UpdatePolicy][]. Attributes: - policy (google.cloud.binaryauthorization_v1beta1.types.Policy): + policy_ (google.cloud.binaryauthorization_v1beta1.types.Policy): Required. A new or updated [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will overwrite the [policy @@ -62,7 +62,7 @@ class UpdatePolicyRequest(proto.Message): format ``projects/*/policy``. """ - policy = proto.Field(proto.MESSAGE, number=1, message=resources.Policy,) + policy_ = proto.Field(proto.MESSAGE, number=1, message=resources.Policy,) class CreateAttestorRequest(proto.Message): diff --git a/scripts/fixup_binaryauthorization_v1beta1_keywords.py b/scripts/fixup_binaryauthorization_v1beta1_keywords.py index 6d42b25..56d9bd4 100644 --- a/scripts/fixup_binaryauthorization_v1beta1_keywords.py +++ b/scripts/fixup_binaryauthorization_v1beta1_keywords.py @@ -47,7 +47,7 @@ class binaryauthorizationCallTransformer(cst.CSTTransformer): 'get_policy': ('name', ), 'list_attestors': ('parent', 'page_size', 'page_token', ), 'update_attestor': ('attestor', ), - 'update_policy': ('policy', ), + 'update_policy': ('policy_', ), } diff --git a/synth.metadata b/synth.metadata index 5a69281..84f33cc 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,8 +11,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "56fc6d43fed71188d7e18f3ca003544646c4ab35", - "internalRef": "366346972" + "sha": "2490be32f08cccc870862ea86920f58325795c89", + "internalRef": "366826395" } }, { diff --git a/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py b/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py index 0c18968..cb13870 100644 --- a/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py +++ b/tests/unit/gapic/binaryauthorization_v1beta1/test_binauthz_management_service_v1_beta1.py @@ -910,14 +910,14 @@ def test_update_policy_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.update_policy(policy=resources.Policy(name="name_value"),) + client.update_policy(policy_=resources.Policy(name="name_value"),) # Establish that the underlying call was made with the expected # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].policy == resources.Policy(name="name_value") + assert args[0].policy_ == resources.Policy(name="name_value") def test_update_policy_flattened_error(): @@ -929,7 +929,7 @@ def test_update_policy_flattened_error(): # fields is an error. with pytest.raises(ValueError): client.update_policy( - service.UpdatePolicyRequest(), policy=resources.Policy(name="name_value"), + service.UpdatePolicyRequest(), policy_=resources.Policy(name="name_value"), ) @@ -948,7 +948,7 @@ async def test_update_policy_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.update_policy( - policy=resources.Policy(name="name_value"), + policy_=resources.Policy(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -956,7 +956,7 @@ async def test_update_policy_flattened_async(): assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].policy == resources.Policy(name="name_value") + assert args[0].policy_ == resources.Policy(name="name_value") @pytest.mark.asyncio @@ -969,7 +969,7 @@ async def test_update_policy_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.update_policy( - service.UpdatePolicyRequest(), policy=resources.Policy(name="name_value"), + service.UpdatePolicyRequest(), policy_=resources.Policy(name="name_value"), )