addCommunicationToCase method

Future<AddCommunicationToCaseResponse> addCommunicationToCase({
  1. required String communicationBody,
  2. String? attachmentSetId,
  3. String? caseId,
  4. List<String>? ccEmailAddresses,
})

Adds additional customer communication to an AWS Support case. Use the caseId parameter to identify the case to which to add communication. You can list a set of email addresses to copy on the communication by using the ccEmailAddresses parameter. The communicationBody value contains the text of the communication.

  • You must have a Business or Enterprise support plan to use the AWS Support API.
  • If you call the AWS Support API from an account that does not have a Business or Enterprise support plan, the SubscriptionRequiredException error message appears. For information about changing your support plan, see AWS Support.

May throw InternalServerError. May throw CaseIdNotFound. May throw AttachmentSetIdNotFound. May throw AttachmentSetExpired.

Parameter communicationBody : The body of an email communication to add to the support case.

Parameter attachmentSetId : The ID of a set of one or more attachments for the communication to add to the case. Create the set by calling AddAttachmentsToSet

Parameter caseId : The AWS Support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-12345678910-2013-c4c1d2bf33c5cf47

Parameter ccEmailAddresses : The email addresses in the CC line of an email to be added to the support case.

Implementation

Future<AddCommunicationToCaseResponse> addCommunicationToCase({
  required String communicationBody,
  String? attachmentSetId,
  String? caseId,
  List<String>? ccEmailAddresses,
}) async {
  ArgumentError.checkNotNull(communicationBody, 'communicationBody');
  _s.validateStringLength(
    'communicationBody',
    communicationBody,
    1,
    8000,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSSupport_20130415.AddCommunicationToCase'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'communicationBody': communicationBody,
      if (attachmentSetId != null) 'attachmentSetId': attachmentSetId,
      if (caseId != null) 'caseId': caseId,
      if (ccEmailAddresses != null) 'ccEmailAddresses': ccEmailAddresses,
    },
  );

  return AddCommunicationToCaseResponse.fromJson(jsonResponse.body);
}