updateRouteResponse method
Updates a RouteResponse.
May throw NotFoundException. May throw TooManyRequestsException. May throw BadRequestException. May throw ConflictException.
Parameter apiId
:
The API identifier.
Parameter routeId
:
The route ID.
Parameter routeResponseId
:
The route response ID.
Parameter modelSelectionExpression
:
The model selection expression for the route response. Supported only for
WebSocket APIs.
Parameter responseModels
:
The response models for the route response.
Parameter responseParameters
:
The route response parameters.
Parameter routeResponseKey
:
The route response key.
Implementation
Future<UpdateRouteResponseResponse> updateRouteResponse({
required String apiId,
required String routeId,
required String routeResponseId,
String? modelSelectionExpression,
Map<String, String>? responseModels,
Map<String, ParameterConstraints>? responseParameters,
String? routeResponseKey,
}) async {
ArgumentError.checkNotNull(apiId, 'apiId');
ArgumentError.checkNotNull(routeId, 'routeId');
ArgumentError.checkNotNull(routeResponseId, 'routeResponseId');
final $payload = <String, dynamic>{
if (modelSelectionExpression != null)
'modelSelectionExpression': modelSelectionExpression,
if (responseModels != null) 'responseModels': responseModels,
if (responseParameters != null) 'responseParameters': responseParameters,
if (routeResponseKey != null) 'routeResponseKey': routeResponseKey,
};
final response = await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/v2/apis/${Uri.encodeComponent(apiId)}/routes/${Uri.encodeComponent(routeId)}/routeresponses/${Uri.encodeComponent(routeResponseId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateRouteResponseResponse.fromJson(response);
}