createSlotTypeVersion method
Creates a new version of a slot type based on the $LATEST
version of the specified slot type. If the $LATEST
version of
this resource has not changed since the last version that you created,
Amazon Lex doesn't create a new version. It returns the last version that
you created.
When you create a version of a slot type, Amazon Lex sets the version to
- Subsequent versions increment by 1. For more information, see versioning-intro.
This operation requires permissions for the
lex:CreateSlotTypeVersion
action.
May throw NotFoundException. May throw ConflictException. May throw LimitExceededException. May throw InternalFailureException. May throw BadRequestException. May throw PreconditionFailedException.
Parameter name
:
The name of the slot type that you want to create a new version for. The
name is case sensitive.
Parameter checksum
:
Checksum for the $LATEST
version of the slot type that you
want to publish. If you specify a checksum and the $LATEST
version of the slot type has a different checksum, Amazon Lex returns a
PreconditionFailedException
exception and doesn't publish the
new version. If you don't specify a checksum, Amazon Lex publishes the
$LATEST
version.
Implementation
Future<CreateSlotTypeVersionResponse> createSlotTypeVersion({
required String name,
String? checksum,
}) async {
ArgumentError.checkNotNull(name, 'name');
_s.validateStringLength(
'name',
name,
1,
100,
isRequired: true,
);
final $payload = <String, dynamic>{
if (checksum != null) 'checksum': checksum,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/slottypes/${Uri.encodeComponent(name)}/versions',
exceptionFnMap: _exceptionFns,
);
return CreateSlotTypeVersionResponse.fromJson(response);
}