updateApiDestination method
Updates an API destination.
May throw ConcurrentModificationException.
May throw InternalException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
Parameter name :
The name of the API destination to update.
Parameter connectionArn :
The ARN of the connection to use for the API destination.
Parameter description :
The name of the API destination to update.
Parameter httpMethod :
The method to use for the API destination.
Parameter invocationEndpoint :
The URL to the endpoint to use for the API destination.
Parameter invocationRateLimitPerSecond :
The maximum number of invocations per second to send to the API
destination.
Implementation
Future<UpdateApiDestinationResponse> updateApiDestination({
required String name,
String? connectionArn,
String? description,
ApiDestinationHttpMethod? httpMethod,
String? invocationEndpoint,
int? invocationRateLimitPerSecond,
}) async {
_s.validateNumRange(
'invocationRateLimitPerSecond',
invocationRateLimitPerSecond,
1,
1152921504606846976,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSEvents.UpdateApiDestination'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Name': name,
if (connectionArn != null) 'ConnectionArn': connectionArn,
if (description != null) 'Description': description,
if (httpMethod != null) 'HttpMethod': httpMethod.value,
if (invocationEndpoint != null)
'InvocationEndpoint': invocationEndpoint,
if (invocationRateLimitPerSecond != null)
'InvocationRateLimitPerSecond': invocationRateLimitPerSecond,
},
);
return UpdateApiDestinationResponse.fromJson(jsonResponse.body);
}