Skip to content

update_case_rule async

update_case_rule(
    domain_id: DomainId,
    case_rule_id: CaseRuleId,
    *,
    config_overrides: Optional[AsyncConnectCasesClientConfig] = None,
    name: Optional[CaseRuleName] = None,
    description: Optional[CaseRuleDescription] = None,
    rule: Optional[CaseRuleDetails] = None,
) -> UpdateCaseRuleResponse

Updates a case rule. In the Amazon Connect admin website, case rules are known as case field conditions. For more information about case field conditions, see Add case field conditions to a case template.

Parameters:

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.

  • InternalServerException –

    We couldn't process your request because of an issue with the server. Try again later.

  • ResourceNotFoundException –

    We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.

  • ServiceQuotaExceededException –

    The service quota has been exceeded. For a list of service quotas, see Amazon Connect Service Quotas in the Amazon Connect Administrator Guide.

  • ThrottlingException –

    The rate has been exceeded for this API. Please try again after a few minutes.

  • ValidationException –

    The request isn't valid. Check the syntax and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_connectcases/_services/async_connect_cases.py
async def update_case_rule(
    self,
    domain_id: "capo_connectcases.types.domain_id.DomainId",
    case_rule_id: "capo_connectcases.types.case_rule_id.CaseRuleId",
    *,
    config_overrides: Optional[AsyncConnectCasesClientConfig] = None,
    name: Optional["capo_connectcases.types.case_rule_name.CaseRuleName"] = None,
    description: Optional[
        "capo_connectcases.types.case_rule_description.CaseRuleDescription"
    ] = None,
    rule: Optional[
        "capo_connectcases.types.case_rule_details.CaseRuleDetails"
    ] = None,
) -> "capo_connectcases.types.update_case_rule_response.UpdateCaseRuleResponse":
    """<p>Updates a case rule. In the Amazon Connect admin website, case rules are known as <i>case field conditions</i>. For more information about case field conditions, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/case-field-conditions.html">Add case field conditions to a case template</a>.</p>

    Args:
        domain_id: <p>Unique identifier of a Cases domain.</p>
        case_rule_id: <p>Unique identifier of a case rule.</p>
        name: <p>Name of the case rule.</p>
        description: <p>Description of a case rule.</p>
        rule: <p>Represents what rule type should take place, under what conditions.</p>

    Raises:
        capo_connectcases.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_connectcases.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.</p>
        capo_connectcases.errors.internal_server_exception.InternalServerException: <p>We couldn't process your request because of an issue with the server. Try again later.</p>
        capo_connectcases.errors.resource_not_found_exception.ResourceNotFoundException: <p>We couldn't find the requested resource. Check that your resources exists and were created in the same Amazon Web Services Region as your request, and try your request again.</p>
        capo_connectcases.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded. For a list of service quotas, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html">Amazon Connect Service Quotas</a> in the <i>Amazon Connect Administrator Guide</i>.</p>
        capo_connectcases.errors.throttling_exception.ThrottlingException: <p>The rate has been exceeded for this API. Please try again after a few minutes.</p>
        capo_connectcases.errors.validation_exception.ValidationException: <p>The request isn't valid. Check the syntax and try again.</p>
        capo_connectcases.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connectcases.types.update_case_rule_request.UpdateCaseRuleRequest]",
    ) -> AsyncOperationResponse[
        "capo_connectcases.types.update_case_rule_response.UpdateCaseRuleResponse"
    ]:
        import capo_connectcases._operations.amazon_connect_cases.update_case_rule

        (
            output,
            http_response,
        ) = await capo_connectcases._operations.amazon_connect_cases.update_case_rule.async_update_case_rule(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateCaseRule")
    )
    input_: capo_connectcases.types.update_case_rule_request.UpdateCaseRuleRequest = {
        "domain_id": domain_id,
        "case_rule_id": case_rule_id,
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if rule is not None:
        input_["rule"] = rule

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