listOpportunityFromEngagementTasks method

Future<ListOpportunityFromEngagementTasksResponse> listOpportunityFromEngagementTasks({
  1. required String catalog,
  2. List<String>? contextIdentifier,
  3. List<String>? engagementIdentifier,
  4. int? maxResults,
  5. String? nextToken,
  6. List<String>? opportunityIdentifier,
  7. ListTasksSortBase? sort,
  8. List<String>? taskIdentifier,
  9. List<TaskStatus>? taskStatus,
})

Lists all in-progress, completed, or failed opportunity creation tasks from engagements that were initiated by the caller's account.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter catalog : Specifies the catalog related to the request. Valid values are AWS for production environments and Sandbox for testing or development purposes. The catalog determines which environment the task data is retrieved from.

Parameter contextIdentifier : Filters tasks by the identifiers of the engagement contexts associated with the opportunity creation. Use this to find tasks related to specific contextual information within engagements that are being converted to opportunities.

Parameter engagementIdentifier : Filters tasks by the identifiers of the engagements from which opportunities are being created. Use this to find all opportunity creation tasks associated with a specific engagement.

Parameter maxResults : Specifies the maximum number of results to return in a single page of the response. Use this parameter to control the number of items returned in each request, which can be useful for performance tuning and managing large result sets.

Parameter nextToken : The token for requesting the next page of results. This value is obtained from the NextToken field in the response of a previous call to this API. Use this parameter for pagination when the result set spans multiple pages.

Parameter opportunityIdentifier : Filters tasks by the identifiers of the opportunities they created or are associated with. Use this to find tasks related to specific opportunity creation processes.

Parameter taskIdentifier : Filters tasks by their unique identifiers. Use this when you want to retrieve information about specific tasks. Provide the task ID to get details about a particular opportunity creation task.

Parameter taskStatus : Filters the tasks based on their current status. This allows you to focus on tasks in specific states. Valid values are COMPLETE for tasks that have finished successfully, INPROGRESS for tasks that are currently running, and FAILED for tasks that have encountered an error and failed to complete.

Implementation

Future<ListOpportunityFromEngagementTasksResponse>
    listOpportunityFromEngagementTasks({
  required String catalog,
  List<String>? contextIdentifier,
  List<String>? engagementIdentifier,
  int? maxResults,
  String? nextToken,
  List<String>? opportunityIdentifier,
  ListTasksSortBase? sort,
  List<String>? taskIdentifier,
  List<TaskStatus>? taskStatus,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target':
        'AWSPartnerCentralSelling.ListOpportunityFromEngagementTasks'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Catalog': catalog,
      if (contextIdentifier != null) 'ContextIdentifier': contextIdentifier,
      if (engagementIdentifier != null)
        'EngagementIdentifier': engagementIdentifier,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (opportunityIdentifier != null)
        'OpportunityIdentifier': opportunityIdentifier,
      if (sort != null) 'Sort': sort,
      if (taskIdentifier != null) 'TaskIdentifier': taskIdentifier,
      if (taskStatus != null)
        'TaskStatus': taskStatus.map((e) => e.value).toList(),
    },
  );

  return ListOpportunityFromEngagementTasksResponse.fromJson(
      jsonResponse.body);
}