updateRelatedItem method

Future<UpdateRelatedItemResponse> updateRelatedItem({
  1. required String caseId,
  2. required RelatedItemUpdateContent content,
  3. required String domainId,
  4. required String relatedItemId,
  5. UserUnion? performedBy,
})

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.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter caseId : A unique identifier of the case.

Parameter content : The content of a related item to be updated.

Parameter domainId : The unique identifier of the Cases domain.

Parameter relatedItemId : Unique identifier of a related item.

Parameter performedBy : Represents the user who performed the update of the related item.

Implementation

Future<UpdateRelatedItemResponse> updateRelatedItem({
  required String caseId,
  required RelatedItemUpdateContent content,
  required String domainId,
  required String relatedItemId,
  UserUnion? performedBy,
}) async {
  final $payload = <String, dynamic>{
    'content': content,
    if (performedBy != null) 'performedBy': performedBy,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/domains/${Uri.encodeComponent(domainId)}/cases/${Uri.encodeComponent(caseId)}/related-items/${Uri.encodeComponent(relatedItemId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateRelatedItemResponse.fromJson(response);
}