updateDashboard method

Future<UpdateDashboardResponse> updateDashboard({
  1. required String arn,
  2. required String name,
  3. String? description,
  4. List<Widget>? widgets,
})

Updates an existing dashboard's properties, including its name, description, and widget configurations.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter arn : The ARN of the dashboard to update.

Parameter name : The new name for the dashboard.

Parameter description : The new description for the dashboard.

Parameter widgets : The updated array of widget configurations for the dashboard. Replaces all existing widgets.

Implementation

Future<UpdateDashboardResponse> updateDashboard({
  required String arn,
  required String name,
  String? description,
  List<Widget>? widgets,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSBCMDashboardsService.UpdateDashboard'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'arn': arn,
      'name': name,
      if (description != null) 'description': description,
      if (widgets != null) 'widgets': widgets,
    },
  );

  return UpdateDashboardResponse.fromJson(jsonResponse.body);
}