createPartnerEventSource method
Called by an SaaS partner to create a partner event source. This operation is not used by Amazon Web Services customers.
Each partner event source can be used by one Amazon Web Services account to create a matching partner event bus in that Amazon Web Services account. A SaaS partner must create one partner event source for each Amazon Web Services account that wants to receive those event types.
A partner event source creates events based on resources within the SaaS partner's service or application.
An Amazon Web Services account that creates a partner event bus that matches the partner event source can use that event bus to receive events from the partner, and then process them using Amazon Web Services Events rules and targets.
Partner event source names follow this format:
partner_name/event_namespace/event_name
- partner_name is determined during partner registration, and identifies the partner to Amazon Web Services customers.
- event_namespace is determined by the partner, and is a way for the partner to categorize their events.
-
event_name is determined by the partner, and should uniquely
identify an event-generating resource within the partner system.
The event_name must be unique across all Amazon Web Services customers. This is because the event source is a shared resource between the partner and customer accounts, and each partner event source unique in the partner account.
May throw ConcurrentModificationException.
May throw InternalException.
May throw LimitExceededException.
May throw OperationDisabledException.
May throw ResourceAlreadyExistsException.
Parameter account :
The Amazon Web Services account ID that is permitted to create a matching
partner event bus for this partner event source.
Parameter name :
The name of the partner event source. This name must be unique and must be
in the format
partner_name/event_namespace/event_name . The
Amazon Web Services account that wants to use this partner event source
must create a partner event bus with a name that matches the name of the
partner event source.
Implementation
Future<CreatePartnerEventSourceResponse> createPartnerEventSource({
required String account,
required String name,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSEvents.CreatePartnerEventSource'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Account': account,
'Name': name,
},
);
return CreatePartnerEventSourceResponse.fromJson(jsonResponse.body);
}