listProjectAssets method

Future<ListProjectAssetsResponse> listProjectAssets({
  1. required String projectId,
  2. int? maxResults,
  3. String? nextToken,
})

Retrieves a paginated list of assets associated with an IoT SiteWise Monitor project.

May throw InternalFailureException. May throw InvalidRequestException. May throw ThrottlingException.

Parameter projectId : The ID of the project.

Parameter maxResults : The maximum number of results to return for each paginated request.

Default: 50

Parameter nextToken : The token to be used for the next set of paginated results.

Implementation

Future<ListProjectAssetsResponse> listProjectAssets({
  required String projectId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/projects/${Uri.encodeComponent(projectId)}/assets',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListProjectAssetsResponse.fromJson(response);
}