Skip to content

update_related_item async

update_related_item(
    domain_id: DomainId,
    case_id: CaseId,
    related_item_id: RelatedItemId,
    content: RelatedItemUpdateContent,
    *,
    config_overrides: Optional[AsyncConnectCasesClientConfig] = None,
    performed_by: Optional[UserUnion] = None,
) -> UpdateRelatedItemResponse

Updates the content of a related item associated with a case. The following related item types are supported:

  • Comment - Update the text content of an existing comment

  • Custom - Update the fields of a custom related item. You can add, modify, and remove fields from a custom related item. There's a quota for the number of fields allowed in a Custom type related item. See Amazon Connect Cases quotas.

Important things to know

  • When updating a Custom related item, all existing and new fields, and their associated values should be included in the request. Fields not included as part of this request will be removed.

  • If you provide a value for performedBy.userArn you must also have DescribeUser permission on the ARN of the user that you provide.

  • System case fields cannot be used in a custom related item.

Endpoints: See Amazon Connect endpoints and quotas.

Parameters:

  • domain_id (DomainId) –

    The unique identifier of the Cases domain.

  • case_id (CaseId) –

    A unique identifier of the case.

  • related_item_id (RelatedItemId) –

    Unique identifier of a related item.

  • content (RelatedItemUpdateContent) –

    The content of a related item to be updated.

  • performed_by (Optional[UserUnion], default: None ) –

    Represents the user who performed the update of the related item.

Raises:

Source code in docs_src/capo_connectcases/_services/async_connect_cases.py
async def update_related_item(
    self,
    domain_id: "capo_connectcases.types.domain_id.DomainId",
    case_id: "capo_connectcases.types.case_id.CaseId",
    related_item_id: "capo_connectcases.types.related_item_id.RelatedItemId",
    content: "capo_connectcases.types.related_item_update_content.RelatedItemUpdateContent",
    *,
    config_overrides: Optional[AsyncConnectCasesClientConfig] = None,
    performed_by: Optional["capo_connectcases.types.user_union.UserUnion"] = None,
) -> (
    "capo_connectcases.types.update_related_item_response.UpdateRelatedItemResponse"
):
    """<p>Updates the content of a related item associated with a case. The following related item types are supported:</p> <ul> <li> <p> <b>Comment</b> - Update the text content of an existing comment</p> </li> <li> <p> <b>Custom</b> - Update the fields of a custom related item. You can add, modify, and remove fields from a custom related item. There's a quota for the number of fields allowed in a Custom type related item. See <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#cases-quotas">Amazon Connect Cases quotas</a>.</p> </li> </ul> <p> <b>Important things to know</b> </p> <ul> <li> <p>When updating a Custom related item, all existing and new fields, and their associated values should be included in the request. Fields not included as part of this request will be removed.</p> </li> <li> <p>If you provide a value for <code>performedBy.userArn</code> you must also have <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html">DescribeUser</a> permission on the ARN of the user that you provide.</p> </li> <li> <p> <a href="https://docs.aws.amazon.com/connect/latest/adminguide/case-fields.html#system-case-fields">System case fields</a> cannot be used in a custom related item.</p> </li> </ul> <p> <b>Endpoints</b>: See <a href="https://docs.aws.amazon.com/general/latest/gr/connect_region.html">Amazon Connect endpoints and quotas</a>.</p>

    Args:
        domain_id: <p>The unique identifier of the Cases domain. </p>
        case_id: <p>A unique identifier of the case.</p>
        related_item_id: <p>Unique identifier of a related item.</p>
        content: <p>The content of a related item to be updated.</p>
        performed_by: <p>Represents the user who performed the update of the related item.</p>

    Raises:
        capo_connectcases.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</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_related_item_request.UpdateRelatedItemRequest]",
    ) -> AsyncOperationResponse[
        "capo_connectcases.types.update_related_item_response.UpdateRelatedItemResponse"
    ]:
        import capo_connectcases._operations.amazon_connect_cases.update_related_item

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

    def _redact_input(
        input_: "capo_connectcases.types.update_related_item_request.UpdateRelatedItemRequest",
    ) -> dict[str, Any]:
        import capo_connectcases.types.update_related_item_request

        return capo_connectcases.types.update_related_item_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_connectcases.types.update_related_item_response.UpdateRelatedItemResponse",
    ) -> dict[str, Any]:
        import capo_connectcases.types.update_related_item_response

        return (
            capo_connectcases.types.update_related_item_response.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateRelatedItem",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_connectcases.types.update_related_item_request.UpdateRelatedItemRequest = {
        "domain_id": domain_id,
        "case_id": case_id,
        "related_item_id": related_item_id,
        "content": content,
    }
    if performed_by is not None:
        input_["performed_by"] = performed_by

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