updateAuthorizer method
Updates an authorizer.
May throw ResourceNotFoundException. May throw InvalidRequestException. May throw LimitExceededException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException.
Parameter authorizerName
:
The authorizer name.
Parameter authorizerFunctionArn
:
The ARN of the authorizer's Lambda function.
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,
AuthorizerStatus? status,
String? tokenKeyName,
Map<String, String>? tokenSigningPublicKeys,
}) async {
ArgumentError.checkNotNull(authorizerName, 'authorizerName');
_s.validateStringLength(
'authorizerName',
authorizerName,
1,
128,
isRequired: true,
);
_s.validateStringLength(
'authorizerFunctionArn',
authorizerFunctionArn,
0,
2048,
);
_s.validateStringLength(
'tokenKeyName',
tokenKeyName,
1,
128,
);
final $payload = <String, dynamic>{
if (authorizerFunctionArn != null)
'authorizerFunctionArn': authorizerFunctionArn,
if (status != null) 'status': status.toValue(),
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);
}