describeCommunications method

Future<DescribeCommunicationsResponse> describeCommunications({
  1. required String caseId,
  2. String? afterTime,
  3. String? beforeTime,
  4. int? maxResults,
  5. String? nextToken,
})

Returns communications and attachments for one or more support cases. Use the afterTime and beforeTime parameters to filter by date. You can use the caseId parameter to restrict the results to a specific case.

Case data is available for 12 months after creation. If a case was created more than 12 months ago, a request for data might cause an error.

You can use the maxResults and nextToken parameters to control the pagination of the results. Set maxResults to the number of cases that you want to display on each page, and use nextToken to specify the resumption of pagination.

  • 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.

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 afterTime : The start date for a filtered date search on support case communications. Case communications are available for 12 months after creation.

Parameter beforeTime : The end date for a filtered date search on support case communications. Case communications are available for 12 months after creation.

Parameter maxResults : The maximum number of results to return before paginating.

Parameter nextToken : A resumption point for pagination.

Implementation

Future<DescribeCommunicationsResponse> describeCommunications({
  required String caseId,
  String? afterTime,
  String? beforeTime,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(caseId, 'caseId');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    10,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSSupport_20130415.DescribeCommunications'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'caseId': caseId,
      if (afterTime != null) 'afterTime': afterTime,
      if (beforeTime != null) 'beforeTime': beforeTime,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return DescribeCommunicationsResponse.fromJson(jsonResponse.body);
}