listDashboards method

Future<ListDashboardsResponse> listDashboards({
  1. int? maxResults,
  2. String? namePrefix,
  3. String? nextToken,
  4. DashboardType? type,
})

Returns information about all dashboards in the account, in the current Region.

May throw UnsupportedOperationException.

Parameter maxResults : The maximum number of dashboards to display on a single page.

Parameter namePrefix : Specify a name prefix to filter on.

Parameter nextToken : A token you can use to get the next page of dashboard results.

Parameter type : Specify a dashboard type to filter on: CUSTOM or MANAGED.

Implementation

Future<ListDashboardsResponse> listDashboards({
  int? maxResults,
  String? namePrefix,
  String? nextToken,
  DashboardType? type,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CloudTrail_20131101.ListDashboards'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'MaxResults': maxResults,
      if (namePrefix != null) 'NamePrefix': namePrefix,
      if (nextToken != null) 'NextToken': nextToken,
      if (type != null) 'Type': type.value,
    },
  );

  return ListDashboardsResponse.fromJson(jsonResponse.body);
}