listPagesByContact method

Future<ListPagesByContactResult> listPagesByContact({
  1. required String contactId,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the engagements to a contact's contact channels.

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

Parameter contactId : The Amazon Resource Name (ARN) of the contact you are retrieving engagements for.

Parameter maxResults : The maximum number of engagements to contact channels to list per page of results.

Parameter nextToken : The pagination token to continue to the next page of results.

Implementation

Future<ListPagesByContactResult> listPagesByContact({
  required String contactId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    1024,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SSMContacts.ListPagesByContact'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ContactId': contactId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListPagesByContactResult.fromJson(jsonResponse.body);
}