getAllGadgets method

Future<DashboardGadgetResponse> getAllGadgets({
  1. required int dashboardId,
  2. List<String>? moduleKey,
  3. List<String>? uri,
  4. List<int>? gadgetId,
})

Returns a list of dashboard gadgets on a dashboard.

This operation returns:

  • Gadgets from a list of IDs, when id is set.
  • Gadgets with a module key, when moduleKey is set.
  • Gadgets from a list of URIs, when uri is set.
  • All gadgets, when no other parameters are set.

This operation can be accessed anonymously.

Permissions required: None.

Implementation

Future<DashboardGadgetResponse> getAllGadgets(
    {required int dashboardId,
    List<String>? moduleKey,
    List<String>? uri,
    List<int>? gadgetId}) async {
  return DashboardGadgetResponse.fromJson(await _client.send(
    'get',
    'rest/api/3/dashboard/{dashboardId}/gadget',
    pathParameters: {
      'dashboardId': '$dashboardId',
    },
    queryParameters: {
      if (moduleKey != null) 'moduleKey': moduleKey.map((e) => e).join(','),
      if (uri != null) 'uri': uri.map((e) => e).join(','),
      if (gadgetId != null) 'gadgetId': gadgetId.map((e) => '$e').join(','),
    },
  ));
}