describeKeywords method

Future<DescribeKeywordsResult> describeKeywords({
  1. required String originationIdentity,
  2. List<KeywordFilter>? filters,
  3. List<String>? keywords,
  4. int? maxResults,
  5. String? nextToken,
})

Describes the specified keywords or all keywords on your origination phone number or pool.

A keyword is a word that you can search for on a particular phone number or pool. It is also a specific word or phrase that an end user can send to your number to elicit a response, such as an informational message or a special offer. When your number receives a message that begins with a keyword, End User Messaging SMS responds with a customizable message.

If you specify a keyword that isn't valid, an error is returned.

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

Parameter originationIdentity : The origination identity to use such as a PhoneNumberId, PhoneNumberArn, SenderId or SenderIdArn. You can use DescribePhoneNumbers to find the values for PhoneNumberId and PhoneNumberArn while DescribeSenderIds can be used to get the values for SenderId and SenderIdArn.

Parameter filters : An array of keyword filters to filter the results.

Parameter keywords : An array of keywords to search for.

Parameter maxResults : The maximum number of results to return per each request.

Parameter nextToken : The token to be used for the next set of paginated results. You don't need to supply a value for this field in the initial request.

Implementation

Future<DescribeKeywordsResult> describeKeywords({
  required String originationIdentity,
  List<KeywordFilter>? filters,
  List<String>? keywords,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PinpointSMSVoiceV2.DescribeKeywords'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'OriginationIdentity': originationIdentity,
      if (filters != null) 'Filters': filters,
      if (keywords != null) 'Keywords': keywords,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeKeywordsResult.fromJson(jsonResponse.body);
}