putDefaultEncryptionConfiguration method

Future<PutDefaultEncryptionConfigurationResponse> putDefaultEncryptionConfiguration({
  1. required EncryptionType encryptionType,
  2. String? kmsKeyArn,
})

Sets the default encryption configuration for the Amazon Web Services account. For more information, see Key management in the AWS IoT SiteWise User Guide.

May throw AccessDeniedException. May throw InternalFailureException. May throw ResourceNotFoundException. May throw ServiceUnavailableException. May throw ThrottlingException. May throw UnauthorizedException. May throw ValidationException.

Parameter encryptionType : The type of encryption used for the encryption configuration.

Parameter kmsKeyArn : The Key Amazon Resource Name (ARN) of the AWS KMS key used for KMS encryption if you use KMS_BASED_ENCRYPTION.

Implementation

Future<PutDefaultEncryptionConfigurationResponse>
    putDefaultEncryptionConfiguration({
  required EncryptionType encryptionType,
  String? kmsKeyArn,
}) async {
  final $payload = <String, dynamic>{
    'encryptionType': encryptionType.value,
    if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/configuration/account/encryption',
    exceptionFnMap: _exceptionFns,
  );
  return PutDefaultEncryptionConfigurationResponse.fromJson(response);
}