listWorkteams method

Future<ListWorkteamsResponse> listWorkteams({
  1. int? maxResults,
  2. String? nameContains,
  3. String? nextToken,
  4. ListWorkteamsSortByOptions? sortBy,
  5. SortOrder? sortOrder,
})

Gets a list of private work teams that you have defined in a region. The list may be empty if no work team satisfies the filter specified in the NameContains parameter.

Parameter maxResults : The maximum number of work teams to return in each page of the response.

Parameter nameContains : A string in the work team's name. This filter returns only work teams whose name contains the specified string.

Parameter nextToken : If the result of the previous ListWorkteams request was truncated, the response includes a NextToken. To retrieve the next set of labeling jobs, use the token in the next request.

Parameter sortBy : The field to sort results by. The default is CreationTime.

Parameter sortOrder : The sort order for results. The default is Ascending.

Implementation

Future<ListWorkteamsResponse> listWorkteams({
  int? maxResults,
  String? nameContains,
  String? nextToken,
  ListWorkteamsSortByOptions? sortBy,
  SortOrder? sortOrder,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nameContains',
    nameContains,
    1,
    63,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    8192,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListWorkteams'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'MaxResults': maxResults,
      if (nameContains != null) 'NameContains': nameContains,
      if (nextToken != null) 'NextToken': nextToken,
      if (sortBy != null) 'SortBy': sortBy.toValue(),
      if (sortOrder != null) 'SortOrder': sortOrder.toValue(),
    },
  );

  return ListWorkteamsResponse.fromJson(jsonResponse.body);
}