listDeviceFleets method

Future<ListDeviceFleetsResponse> listDeviceFleets({
  1. DateTime? creationTimeAfter,
  2. DateTime? creationTimeBefore,
  3. DateTime? lastModifiedTimeAfter,
  4. DateTime? lastModifiedTimeBefore,
  5. int? maxResults,
  6. String? nameContains,
  7. String? nextToken,
  8. ListDeviceFleetsSortBy? sortBy,
  9. SortOrder? sortOrder,
})

Returns a list of devices in the fleet.

Parameter creationTimeAfter : Filter fleets where packaging job was created after specified time.

Parameter creationTimeBefore : Filter fleets where the edge packaging job was created before specified time.

Parameter lastModifiedTimeAfter : Select fleets where the job was updated after X

Parameter lastModifiedTimeBefore : Select fleets where the job was updated before X

Parameter maxResults : The maximum number of results to select.

Parameter nameContains : Filter for fleets containing this name in their fleet device name.

Parameter nextToken : The response from the last list when returning a list large enough to need tokening.

Parameter sortBy : The column to sort by.

Parameter sortOrder : What direction to sort in.

Implementation

Future<ListDeviceFleetsResponse> listDeviceFleets({
  DateTime? creationTimeAfter,
  DateTime? creationTimeBefore,
  DateTime? lastModifiedTimeAfter,
  DateTime? lastModifiedTimeBefore,
  int? maxResults,
  String? nameContains,
  String? nextToken,
  ListDeviceFleetsSortBy? sortBy,
  SortOrder? sortOrder,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    100,
  );
  _s.validateStringLength(
    'nameContains',
    nameContains,
    0,
    63,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    8192,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.ListDeviceFleets'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (creationTimeAfter != null)
        'CreationTimeAfter': unixTimestampToJson(creationTimeAfter),
      if (creationTimeBefore != null)
        'CreationTimeBefore': unixTimestampToJson(creationTimeBefore),
      if (lastModifiedTimeAfter != null)
        'LastModifiedTimeAfter': unixTimestampToJson(lastModifiedTimeAfter),
      if (lastModifiedTimeBefore != null)
        'LastModifiedTimeBefore': unixTimestampToJson(lastModifiedTimeBefore),
      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 ListDeviceFleetsResponse.fromJson(jsonResponse.body);
}