updateDashboard method

Future<void> updateDashboard({
  1. required String dashboardDefinition,
  2. required String dashboardId,
  3. required String dashboardName,
  4. String? clientToken,
  5. String? dashboardDescription,
})

Updates an IoT SiteWise Monitor dashboard.

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

Parameter dashboardDefinition : The new dashboard definition, as specified in a JSON literal.

in the IoT SiteWise User Guide

Parameter dashboardId : The ID of the dashboard to update.

Parameter dashboardName : A new friendly name for the dashboard.

Parameter clientToken : A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.

Parameter dashboardDescription : A new description for the dashboard.

Implementation

Future<void> updateDashboard({
  required String dashboardDefinition,
  required String dashboardId,
  required String dashboardName,
  String? clientToken,
  String? dashboardDescription,
}) async {
  final $payload = <String, dynamic>{
    'dashboardDefinition': dashboardDefinition,
    'dashboardName': dashboardName,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (dashboardDescription != null)
      'dashboardDescription': dashboardDescription,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/dashboards/${Uri.encodeComponent(dashboardId)}',
    hostPrefix: 'monitor.',
    exceptionFnMap: _exceptionFns,
  );
}