listTaskTemplates method

Future<ListTaskTemplatesResponse> listTaskTemplates({
  1. required String instanceId,
  2. int? maxResults,
  3. String? name,
  4. String? nextToken,
  5. TaskTemplateStatus? status,
})

Lists task templates for the specified Connect Customer instance.

May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Parameter maxResults : The maximum number of results to return per page.

Parameter name : The name of the task template.

Parameter nextToken : The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Parameter status : Marks a template as ACTIVE or INACTIVE for a task to refer to it. Tasks can only be created from ACTIVE templates. If a template is marked as INACTIVE, then a task that refers to this template cannot be created.

Implementation

Future<ListTaskTemplatesResponse> listTaskTemplates({
  required String instanceId,
  int? maxResults,
  String? name,
  String? nextToken,
  TaskTemplateStatus? status,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (name != null) 'name': [name],
    if (nextToken != null) 'nextToken': [nextToken],
    if (status != null) 'status': [status.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/instance/${Uri.encodeComponent(instanceId)}/task/template',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListTaskTemplatesResponse.fromJson(response);
}