executeScheduledReport method

Future<ExecuteScheduledReportResponse> executeScheduledReport({
  1. required String arn,
  2. String? clientToken,
  3. bool? dryRun,
})

Triggers an immediate execution of a scheduled report, outside of its regular schedule. The scheduled report must be in ENABLED state. Calling this operation on a DISABLED scheduled report returns a ValidationException.

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 execute.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Parameter dryRun : When set to true, validates the scheduled report configuration without triggering an actual execution.

Implementation

Future<ExecuteScheduledReportResponse> executeScheduledReport({
  required String arn,
  String? clientToken,
  bool? dryRun,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSBCMDashboardsService.ExecuteScheduledReport'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'arn': arn,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (dryRun != null) 'dryRun': dryRun,
    },
  );

  return ExecuteScheduledReportResponse.fromJson(jsonResponse.body);
}