startProspectingFromEngagementTask method
Starts a task to convert one or more engagement contexts into new
prospecting leads. The task runs asynchronously. To poll for status, use
GetProspectingFromEngagementTask, or use
ListProspectingFromEngagementTasks to monitor multiple tasks.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter catalog :
Specifies the catalog in which the task is initiated. Specify
AWS for production environments and Sandbox for
testing and development purposes.
Parameter identifiers :
The list of engagement identifiers to include in this prospecting task.
Each identifier must correspond to an existing engagement in the specified
catalog. Maximum of 100 identifiers per task.
Parameter taskName :
A descriptive name for the task. This name helps identify the task in list
and get operations. The name must contain 1 to 128 characters.
Parameter clientToken :
A unique, case-sensitive identifier provided by the client to ensure
idempotency. Making the same request with the same
ClientToken returns the same response without creating a
duplicate task.
Implementation
Future<StartProspectingFromEngagementTaskResponse>
startProspectingFromEngagementTask({
required String catalog,
required List<String> identifiers,
required String taskName,
String? clientToken,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target':
'AWSPartnerCentralSelling.StartProspectingFromEngagementTask'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Catalog': catalog,
'Identifiers': identifiers,
'TaskName': taskName,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
},
);
return StartProspectingFromEngagementTaskResponse.fromJson(
jsonResponse.body);
}