createDatastore method
Create a data store.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter clientToken :
A unique identifier for API idempotency.
Parameter datastoreName :
The data store name.
Parameter kmsKeyArn :
The Amazon Resource Name (ARN) assigned to the Key Management Service
(KMS) key for accessing encrypted data.
Parameter lambdaAuthorizerArn :
The ARN of the authorizer's Lambda function.
Parameter losslessStorageFormat :
The lossless storage format for the datastore.
Parameter tags :
The tags provided when creating a data store.
Implementation
Future<CreateDatastoreResponse> createDatastore({
String? clientToken,
String? datastoreName,
String? kmsKeyArn,
String? lambdaAuthorizerArn,
LosslessStorageFormat? losslessStorageFormat,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (datastoreName != null) 'datastoreName': datastoreName,
if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn,
if (lambdaAuthorizerArn != null)
'lambdaAuthorizerArn': lambdaAuthorizerArn,
if (losslessStorageFormat != null)
'losslessStorageFormat': losslessStorageFormat.value,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/datastore',
exceptionFnMap: _exceptionFns,
);
return CreateDatastoreResponse.fromJson(response);
}