def update_ingress_rule(
            self,
            request: appengine.UpdateIngressRuleRequest = None,
            *,
            retry: retries.Retry = gapic_v1.method.DEFAULT,
            timeout: float = None,
            metadata: Sequence[Tuple[str, str]] = (),
    ) -> firewall.FirewallRule:
        r"""Updates the specified firewall rule.

        Args:
            request (google.cloud.appengine_admin_v1.types.UpdateIngressRuleRequest):
                The request object. Request message for
                `Firewall.UpdateIngressRule`.

            retry (google.api_core.retry.Retry): Designation of what errors, if any,
                should be retried.
            timeout (float): The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            google.cloud.appengine_admin_v1.types.FirewallRule:
                A single firewall rule that is
                evaluated against incoming traffic and
                provides an action to take on matched
                requests.

        """
        # Create or coerce a protobuf request object.

        # Minor optimization to avoid making a copy if the user passes
        # in a appengine.UpdateIngressRuleRequest.
        # There's no risk of modifying the input as we've already verified
        # there are no flattened fields.
        if not isinstance(request, appengine.UpdateIngressRuleRequest):
            request = appengine.UpdateIngressRuleRequest(request)

        # Wrap the RPC method; this adds retry and timeout information,
        # and friendly error handling.
        rpc = self._transport._wrapped_methods[
            self._transport.update_ingress_rule]

        # Certain fields should be provided within the metadata header;
        # add these here.
        metadata = tuple(metadata) + (gapic_v1.routing_header.to_grpc_metadata(
            (("name", request.name), )), )

        # Send the request.
        response = rpc(
            request,
            retry=retry,
            timeout=timeout,
            metadata=metadata,
        )

        # Done; return the response.
        return response
    async def update_ingress_rule(
            self,
            request: appengine.UpdateIngressRuleRequest = None,
            *,
            retry: retries.Retry = gapic_v1.method.DEFAULT,
            timeout: float = None,
            metadata: Sequence[Tuple[str, str]] = (),
    ) -> firewall.FirewallRule:
        r"""Updates the specified firewall rule.

        Args:
            request (:class:`google.cloud.appengine_admin_v1.types.UpdateIngressRuleRequest`):
                The request object. Request message for
                `Firewall.UpdateIngressRule`.
            retry (google.api_core.retry.Retry): Designation of what errors, if any,
                should be retried.
            timeout (float): The timeout for this request.
            metadata (Sequence[Tuple[str, str]]): Strings which should be
                sent along with the request as metadata.

        Returns:
            google.cloud.appengine_admin_v1.types.FirewallRule:
                A single firewall rule that is
                evaluated against incoming traffic and
                provides an action to take on matched
                requests.

        """
        # Create or coerce a protobuf request object.
        request = appengine.UpdateIngressRuleRequest(request)

        # Wrap the RPC method; this adds retry and timeout information,
        # and friendly error handling.
        rpc = gapic_v1.method_async.wrap_method(
            self._client._transport.update_ingress_rule,
            default_timeout=None,
            client_info=DEFAULT_CLIENT_INFO,
        )

        # Certain fields should be provided within the metadata header;
        # add these here.
        metadata = tuple(metadata) + (gapic_v1.routing_header.to_grpc_metadata(
            (("name", request.name), )), )

        # Send the request.
        response = await rpc(
            request,
            retry=retry,
            timeout=timeout,
            metadata=metadata,
        )

        # Done; return the response.
        return response