getSlotTypes method

Future<GetSlotTypesResponse> getSlotTypes({
  1. int? maxResults,
  2. String? nameContains,
  3. String? nextToken,
})

Returns slot type information as follows:

  • If you specify the nameContains field, returns the $LATEST version of all slot types that contain the specified string.
  • If you don't specify the nameContains field, returns information about the $LATEST version of all slot types.
The operation requires permission for the lex:GetSlotTypes action.

May throw NotFoundException. May throw LimitExceededException. May throw InternalFailureException. May throw BadRequestException.

Parameter maxResults : The maximum number of slot types to return in the response. The default is 10.

Parameter nameContains : Substring to match in slot type names. A slot type will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz."

Parameter nextToken : A pagination token that fetches the next page of slot types. If the response to this API call is truncated, Amazon Lex returns a pagination token in the response. To fetch next page of slot types, specify the pagination token in the next request.

Implementation

Future<GetSlotTypesResponse> getSlotTypes({
  int? maxResults,
  String? nameContains,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  _s.validateStringLength(
    'nameContains',
    nameContains,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nameContains != null) 'nameContains': [nameContains],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/slottypes/',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetSlotTypesResponse.fromJson(response);
}