Skip to content

update_gateway_rule async

update_gateway_rule(
    gateway_identifier: GatewayIdentifier,
    rule_id: GatewayRuleId,
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    priority: Optional[GatewayRulePriority] = None,
    conditions: Optional[Conditions] = None,
    actions: Optional[Actions] = None,
    description: Optional[GatewayRuleDescription] = None,
) -> UpdateGatewayRuleResponse

Updates a gateway rule's priority, conditions, actions, or description.

Parameters:

Raises:

Source code in docs_src/capo_bedrock_agentcore_control/_services/async_bedrock_agent_core_control.py
async def update_gateway_rule(
    self,
    gateway_identifier: "capo_bedrock_agentcore_control.types.gateway_identifier.GatewayIdentifier",
    rule_id: "capo_bedrock_agentcore_control.types.gateway_rule_id.GatewayRuleId",
    *,
    config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
    priority: Optional[
        "capo_bedrock_agentcore_control.types.gateway_rule_priority.GatewayRulePriority"
    ] = None,
    conditions: Optional[
        "capo_bedrock_agentcore_control.types.conditions.Conditions"
    ] = None,
    actions: Optional[
        "capo_bedrock_agentcore_control.types.actions.Actions"
    ] = None,
    description: Optional[
        "capo_bedrock_agentcore_control.types.gateway_rule_description.GatewayRuleDescription"
    ] = None,
) -> "capo_bedrock_agentcore_control.types.update_gateway_rule_response.UpdateGatewayRuleResponse":
    """<p>Updates a gateway rule's priority, conditions, actions, or description.</p>

    Args:
        gateway_identifier: <p>The identifier of the gateway containing the rule.</p>
        rule_id: <p>The unique identifier of the rule to update.</p>
        priority: <p>The updated priority of the rule.</p>
        conditions: <p>The updated conditions for the rule.</p>
        actions: <p>The updated actions for the rule.</p>
        description: <p>The updated description of the rule.</p>

    Raises:
        capo_bedrock_agentcore_control.errors.access_denied_exception.AccessDeniedException: <p>This exception is thrown when a request is denied per access permissions</p>
        capo_bedrock_agentcore_control.errors.conflict_exception.ConflictException: <p>This exception is thrown when there is a conflict performing an operation</p>
        capo_bedrock_agentcore_control.errors.internal_server_exception.InternalServerException: <p>This exception is thrown if there was an unexpected error during processing of request</p>
        capo_bedrock_agentcore_control.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource referenced by the operation does not exist</p>
        capo_bedrock_agentcore_control.errors.throttling_exception.ThrottlingException: <p>This exception is thrown when the number of requests exceeds the limit</p>
        capo_bedrock_agentcore_control.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_bedrock_agentcore_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_bedrock_agentcore_control.types.update_gateway_rule_request.UpdateGatewayRuleRequest]",
    ) -> AsyncOperationResponse[
        "capo_bedrock_agentcore_control.types.update_gateway_rule_response.UpdateGatewayRuleResponse"
    ]:
        import capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.update_gateway_rule

        (
            output,
            http_response,
        ) = await capo_bedrock_agentcore_control._operations.amazon_bedrock_agent_core_control.update_gateway_rule.async_update_gateway_rule(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_bedrock_agentcore_control.types.update_gateway_rule_request.UpdateGatewayRuleRequest",
    ) -> dict[str, Any]:
        import capo_bedrock_agentcore_control.types.update_gateway_rule_request

        return capo_bedrock_agentcore_control.types.update_gateway_rule_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_bedrock_agentcore_control.types.update_gateway_rule_response.UpdateGatewayRuleResponse",
    ) -> dict[str, Any]:
        import capo_bedrock_agentcore_control.types.update_gateway_rule_response

        return capo_bedrock_agentcore_control.types.update_gateway_rule_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateGatewayRule",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_bedrock_agentcore_control.types.update_gateway_rule_request.UpdateGatewayRuleRequest = {
        "gateway_identifier": gateway_identifier,
        "rule_id": rule_id,
    }
    if priority is not None:
        input_["priority"] = priority
    if conditions is not None:
        input_["conditions"] = conditions
    if actions is not None:
        input_["actions"] = actions
    if description is not None:
        input_["description"] = description

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output