createViewVersion method
Publishes a new version of the view identifier.
Versions are immutable and monotonically increasing.
It returns the highest version if there is no change in content compared
to that version. An error is displayed if the supplied ViewContentSha256
is different from the ViewContentSha256 of the $LATEST alias.
May throw AccessDeniedException.
May throw InternalServiceException.
May throw InvalidParameterException.
May throw InvalidRequestException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw TooManyRequestsException.
Parameter instanceId :
The identifier of the Connect Customer instance. You can find the
instanceId in the ARN of the instance.
Parameter viewId :
The identifier of the view. Both ViewArn and
ViewId can be used.
Parameter versionDescription :
The description for the version being published.
Parameter viewContentSha256 :
Indicates the checksum value of the latest published view content.
Implementation
Future<CreateViewVersionResponse> createViewVersion({
required String instanceId,
required String viewId,
String? versionDescription,
String? viewContentSha256,
}) async {
final $payload = <String, dynamic>{
if (versionDescription != null) 'VersionDescription': versionDescription,
if (viewContentSha256 != null) 'ViewContentSha256': viewContentSha256,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/views/${Uri.encodeComponent(instanceId)}/${Uri.encodeComponent(viewId)}/versions',
exceptionFnMap: _exceptionFns,
);
return CreateViewVersionResponse.fromJson(response);
}