updateRoute method
- required String apiId,
- required String routeId,
- bool? apiKeyRequired,
- List<
String> ? authorizationScopes, - AuthorizationType? authorizationType,
- String? authorizerId,
- String? modelSelectionExpression,
- String? operationName,
- Map<
String, String> ? requestModels, - Map<
String, ParameterConstraints> ? requestParameters, - String? routeKey,
- String? routeResponseSelectionExpression,
- String? target,
Updates a Route.
May throw NotFoundException. May throw TooManyRequestsException. May throw BadRequestException. May throw ConflictException.
Parameter apiId
:
The API identifier.
Parameter routeId
:
The route ID.
Parameter apiKeyRequired
:
Specifies whether an API key is required for the route. Supported only for
WebSocket APIs.
Parameter authorizationScopes
:
The authorization scopes supported by this route.
Parameter authorizationType
:
The authorization type for the route. For WebSocket APIs, valid values are
NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM
for using a Lambda authorizer For HTTP APIs, valid values are NONE for
open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM
permissions, and CUSTOM for using a Lambda authorizer.
Parameter authorizerId
:
The identifier of the Authorizer resource to be associated with this
route. The authorizer identifier is generated by API Gateway when you
created the authorizer.
Parameter modelSelectionExpression
:
The model selection expression for the route. Supported only for WebSocket
APIs.
Parameter operationName
:
The operation name for the route.
Parameter requestModels
:
The request models for the route. Supported only for WebSocket APIs.
Parameter requestParameters
:
The request parameters for the route. Supported only for WebSocket APIs.
Parameter routeKey
:
The route key for the route.
Parameter routeResponseSelectionExpression
:
The route response selection expression for the route. Supported only for
WebSocket APIs.
Parameter target
:
The target for the route.
Implementation
Future<UpdateRouteResult> updateRoute({
required String apiId,
required String routeId,
bool? apiKeyRequired,
List<String>? authorizationScopes,
AuthorizationType? authorizationType,
String? authorizerId,
String? modelSelectionExpression,
String? operationName,
Map<String, String>? requestModels,
Map<String, ParameterConstraints>? requestParameters,
String? routeKey,
String? routeResponseSelectionExpression,
String? target,
}) async {
ArgumentError.checkNotNull(apiId, 'apiId');
ArgumentError.checkNotNull(routeId, 'routeId');
final $payload = <String, dynamic>{
if (apiKeyRequired != null) 'apiKeyRequired': apiKeyRequired,
if (authorizationScopes != null)
'authorizationScopes': authorizationScopes,
if (authorizationType != null)
'authorizationType': authorizationType.toValue(),
if (authorizerId != null) 'authorizerId': authorizerId,
if (modelSelectionExpression != null)
'modelSelectionExpression': modelSelectionExpression,
if (operationName != null) 'operationName': operationName,
if (requestModels != null) 'requestModels': requestModels,
if (requestParameters != null) 'requestParameters': requestParameters,
if (routeKey != null) 'routeKey': routeKey,
if (routeResponseSelectionExpression != null)
'routeResponseSelectionExpression': routeResponseSelectionExpression,
if (target != null) 'target': target,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/v2/apis/${Uri.encodeComponent(apiId)}/routes/${Uri.encodeComponent(routeId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateRouteResult.fromJson(response);
}