setDefaultAuthorizer method

Future<SetDefaultAuthorizerResponse> setDefaultAuthorizer({
  1. required String authorizerName,
})

Sets the default authorizer. This will be used if a websocket connection is made without specifying an authorizer.

May throw ResourceNotFoundException. May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException. May throw ResourceAlreadyExistsException.

Parameter authorizerName : The authorizer name.

Implementation

Future<SetDefaultAuthorizerResponse> setDefaultAuthorizer({
  required String authorizerName,
}) async {
  ArgumentError.checkNotNull(authorizerName, 'authorizerName');
  _s.validateStringLength(
    'authorizerName',
    authorizerName,
    1,
    128,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'authorizerName': authorizerName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/default-authorizer',
    exceptionFnMap: _exceptionFns,
  );
  return SetDefaultAuthorizerResponse.fromJson(response);
}