addGadget method

Future<DashboardGadget> addGadget({
  1. required int dashboardId,
  2. required DashboardGadgetSettings body,
})

Adds a gadget to a dashboard.

Permissions required: None.

Implementation

Future<DashboardGadget> addGadget(
    {required int dashboardId, required DashboardGadgetSettings body}) async {
  return DashboardGadget.fromJson(await _client.send(
    'post',
    'rest/api/3/dashboard/{dashboardId}/gadget',
    pathParameters: {
      'dashboardId': '$dashboardId',
    },
    body: body.toJson(),
  ));
}