updateEndpoint method

Future<UpdateEndpointResponse> updateEndpoint({
  1. required String name,
  2. String? description,
  3. List<EndpointEventBus>? eventBuses,
  4. ReplicationConfig? replicationConfig,
  5. String? roleArn,
  6. RoutingConfig? routingConfig,
})

Update an existing endpoint. For more information about global endpoints, see Making applications Regional-fault tolerant with global endpoints and event replication in the Amazon EventBridge User Guide .

May throw ConcurrentModificationException. May throw InternalException. May throw ResourceNotFoundException.

Parameter name : The name of the endpoint you want to update.

Parameter description : A description for the endpoint.

Parameter eventBuses : Define event buses used for replication.

Parameter replicationConfig : Whether event replication was enabled or disabled by this request.

Parameter roleArn : The ARN of the role used by event replication for this request.

Parameter routingConfig : Configure the routing policy, including the health check and secondary Region.

Implementation

Future<UpdateEndpointResponse> updateEndpoint({
  required String name,
  String? description,
  List<EndpointEventBus>? eventBuses,
  ReplicationConfig? replicationConfig,
  String? roleArn,
  RoutingConfig? routingConfig,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSEvents.UpdateEndpoint'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (description != null) 'Description': description,
      if (eventBuses != null) 'EventBuses': eventBuses,
      if (replicationConfig != null) 'ReplicationConfig': replicationConfig,
      if (roleArn != null) 'RoleArn': roleArn,
      if (routingConfig != null) 'RoutingConfig': routingConfig,
    },
  );

  return UpdateEndpointResponse.fromJson(jsonResponse.body);
}