listUserProfiles method

Future<ListUserProfilesResponse> listUserProfiles({
  1. String? domainIdEquals,
  2. int? maxResults,
  3. String? nextToken,
  4. UserProfileSortKey? sortBy,
  5. SortOrder? sortOrder,
  6. String? userProfileNameContains,
})

Lists user profiles.

Parameter domainIdEquals : A parameter by which to filter the results.

Parameter maxResults : Returns a list up to a specified limit.

Parameter nextToken : If the previous response was truncated, you will receive this token. Use it in your next request to receive the next set of results.

Parameter sortBy : The parameter by which to sort the results. The default is CreationTime.

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

Parameter userProfileNameContains : A parameter by which to filter the results.

Implementation

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

  return ListUserProfilesResponse.fromJson(jsonResponse.body);
}