updateApiKeyCredentialProvider method

Future<UpdateApiKeyCredentialProviderResponse> updateApiKeyCredentialProvider({
  1. required String name,
  2. String? apiKey,
  3. SecretReference? apiKeySecretConfig,
  4. SecretSourceType? apiKeySecretSource,
})

Updates an existing API key credential provider.

May throw AccessDeniedException. May throw ConflictException. May throw DecryptionFailure. May throw EncryptionFailure. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw UnauthorizedException. May throw ValidationException.

Parameter name : The name of the API key credential provider to update.

Parameter apiKey : The new API key to use for authentication. This value replaces the existing API key and is encrypted and stored securely.

Parameter apiKeySecretConfig : A reference to the AWS Secrets Manager secret that stores the API key. This includes the secret ID and the JSON key used to extract the API key value from the secret. Required when apiKeySecretSource is set to EXTERNAL.

Parameter apiKeySecretSource : The source type of the API key secret. Use MANAGED if the secret is managed by the service, or EXTERNAL if you manage the secret yourself in AWS Secrets Manager.

Implementation

Future<UpdateApiKeyCredentialProviderResponse>
    updateApiKeyCredentialProvider({
  required String name,
  String? apiKey,
  SecretReference? apiKeySecretConfig,
  SecretSourceType? apiKeySecretSource,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    if (apiKey != null) 'apiKey': apiKey,
    if (apiKeySecretConfig != null) 'apiKeySecretConfig': apiKeySecretConfig,
    if (apiKeySecretSource != null)
      'apiKeySecretSource': apiKeySecretSource.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/identities/UpdateApiKeyCredentialProvider',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateApiKeyCredentialProviderResponse.fromJson(response);
}