getSlotTypeVersions method

Future<GetSlotTypeVersionsResponse> getSlotTypeVersions({
  1. required String name,
  2. int? maxResults,
  3. String? nextToken,
})

Gets information about all versions of a slot type.

The GetSlotTypeVersions operation returns a SlotTypeMetadata object for each version of a slot type. For example, if a slot type has three numbered versions, the GetSlotTypeVersions operation returns four SlotTypeMetadata objects in the response, one for each numbered version and one for the $LATEST version.

The GetSlotTypeVersions operation always returns at least one version, the $LATEST version.

This operation requires permissions for the lex:GetSlotTypeVersions action.

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

Parameter name : The name of the slot type for which versions should be returned.

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

Parameter nextToken : A pagination token for fetching the next page of slot type versions. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of versions, specify the pagination token in the next request.

Implementation

Future<GetSlotTypeVersionsResponse> getSlotTypeVersions({
  required String name,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    100,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/slottypes/${Uri.encodeComponent(name)}/versions/',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetSlotTypeVersionsResponse.fromJson(response);
}