createLensVersion method
Create a new lens version.
A lens can have up to 100 versions.
Use this operation to publish a new lens version after you have imported a
lens. The LensAlias is used to identify the lens to be
published. The owner of a lens can share the lens with other Amazon Web
Services accounts and users in the same Amazon Web Services Region. Only
the owner of a lens can delete it.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter lensVersion :
The version of the lens being created.
Parameter isMajorVersion :
Set to true if this new major lens version.
Implementation
Future<CreateLensVersionOutput> createLensVersion({
required String lensAlias,
required String lensVersion,
String? clientRequestToken,
bool? isMajorVersion,
}) async {
final $payload = <String, dynamic>{
'LensVersion': lensVersion,
'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
if (isMajorVersion != null) 'IsMajorVersion': isMajorVersion,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/lenses/${Uri.encodeComponent(lensAlias)}/versions',
exceptionFnMap: _exceptionFns,
);
return CreateLensVersionOutput.fromJson(response);
}