updateAuthorizer method
Updates an authorizer.
Requires permission to access the UpdateAuthorizer action.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
May throw UnauthorizedException.
Parameter authorizerName :
The authorizer name.
Parameter authorizerFunctionArn :
The ARN of the authorizer's Lambda function.
Parameter enableCachingForHttp :
When true, the result from the authorizer’s Lambda function
is cached for the time specified in refreshAfterInSeconds.
The cached result is used while the device reuses the same HTTP
connection.
Parameter status :
The status of the update authorizer request.
Parameter tokenKeyName :
The key used to extract the token from the HTTP headers.
Parameter tokenSigningPublicKeys :
The public keys used to verify the token signature.
Implementation
Future<UpdateAuthorizerResponse> updateAuthorizer({
required String authorizerName,
String? authorizerFunctionArn,
bool? enableCachingForHttp,
AuthorizerStatus? status,
String? tokenKeyName,
Map<String, String>? tokenSigningPublicKeys,
}) async {
final $payload = <String, dynamic>{
if (authorizerFunctionArn != null)
'authorizerFunctionArn': authorizerFunctionArn,
if (enableCachingForHttp != null)
'enableCachingForHttp': enableCachingForHttp,
if (status != null) 'status': status.value,
if (tokenKeyName != null) 'tokenKeyName': tokenKeyName,
if (tokenSigningPublicKeys != null)
'tokenSigningPublicKeys': tokenSigningPublicKeys,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/authorizer/${Uri.encodeComponent(authorizerName)}',
exceptionFnMap: _exceptionFns,
);
return UpdateAuthorizerResponse.fromJson(response);
}