updateScheduledReport method

Future<UpdateScheduledReportResponse> updateScheduledReport({
  1. required String arn,
  2. bool? clearWidgetDateRangeOverride,
  3. bool? clearWidgetIds,
  4. String? dashboardArn,
  5. String? description,
  6. String? name,
  7. ScheduleConfig? scheduleConfig,
  8. String? scheduledReportExecutionRoleArn,
  9. DateTimeRange? widgetDateRangeOverride,
  10. List<String>? widgetIds,
})

Updates an existing scheduled report's properties, including its name, description, schedule configuration, and widget settings. Only the parameters included in the request are updated; all other properties remain unchanged.

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

Parameter arn : The ARN of the scheduled report to update.

Parameter clearWidgetDateRangeOverride : Set to true to clear existing widgetDateRangeOverride.

Parameter clearWidgetIds : Set to true to clear existing widgetIds.

Parameter dashboardArn : The ARN of the dashboard to associate with the scheduled report.

Parameter description : The new description for the scheduled report.

Parameter name : The new name for the scheduled report.

Parameter scheduleConfig : The updated schedule configuration for the report.

Parameter scheduledReportExecutionRoleArn : The ARN of the IAM role that the scheduled report uses to execute. Amazon Web Services Billing and Cost Management Dashboards will assume this IAM role while executing the scheduled report.

Parameter widgetDateRangeOverride : The date range override to apply to widgets in the scheduled report.

Parameter widgetIds : The list of widget identifiers to include in the scheduled report. If not specified, all widgets in the dashboard are included.

Implementation

Future<UpdateScheduledReportResponse> updateScheduledReport({
  required String arn,
  bool? clearWidgetDateRangeOverride,
  bool? clearWidgetIds,
  String? dashboardArn,
  String? description,
  String? name,
  ScheduleConfig? scheduleConfig,
  String? scheduledReportExecutionRoleArn,
  DateTimeRange? widgetDateRangeOverride,
  List<String>? widgetIds,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSBCMDashboardsService.UpdateScheduledReport'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'arn': arn,
      if (clearWidgetDateRangeOverride != null)
        'clearWidgetDateRangeOverride': clearWidgetDateRangeOverride,
      if (clearWidgetIds != null) 'clearWidgetIds': clearWidgetIds,
      if (dashboardArn != null) 'dashboardArn': dashboardArn,
      if (description != null) 'description': description,
      if (name != null) 'name': name,
      if (scheduleConfig != null) 'scheduleConfig': scheduleConfig,
      if (scheduledReportExecutionRoleArn != null)
        'scheduledReportExecutionRoleArn': scheduledReportExecutionRoleArn,
      if (widgetDateRangeOverride != null)
        'widgetDateRangeOverride': widgetDateRangeOverride,
      if (widgetIds != null) 'widgetIds': widgetIds,
    },
  );

  return UpdateScheduledReportResponse.fromJson(jsonResponse.body);
}