listComments method

Future<ListCommentsResponse> listComments({
  1. required String caseId,
  2. int? maxResults,
  3. String? nextToken,
})

Returns comments for a designated case.

Parameter caseId : Required element for ListComments to designate the case to query.

Parameter maxResults : Optional element for ListComments to limit the number of responses.

Parameter nextToken : An optional string that, if supplied, must be copied from the output of a previous call to ListComments. When provided in this manner, the API fetches the next page of results.

Implementation

Future<ListCommentsResponse> listComments({
  required String caseId,
  int? maxResults,
  String? nextToken,
}) async {
  final $payload = <String, dynamic>{
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/cases/${Uri.encodeComponent(caseId)}/list-comments',
    exceptionFnMap: _exceptionFns,
  );
  return ListCommentsResponse.fromJson(response);
}