createReportPlan method

Future<CreateReportPlanOutput> createReportPlan({
  1. required ReportDeliveryChannel reportDeliveryChannel,
  2. required String reportPlanName,
  3. required ReportSetting reportSetting,
  4. String? idempotencyToken,
  5. String? reportPlanDescription,
  6. Map<String, String>? reportPlanTags,
})

Creates a report plan. A report plan is a document that contains information about the contents of the report and where Backup will deliver it.

If you call CreateReportPlan with a plan that already exists, you receive an AlreadyExistsException exception.

May throw AlreadyExistsException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw MissingParameterValueException. May throw ServiceUnavailableException.

Parameter reportDeliveryChannel : A structure that contains information about where and how to deliver your reports, specifically your Amazon S3 bucket name, S3 key prefix, and the formats of your reports.

Parameter reportPlanName : The unique name of the report plan. The name must be between 1 and 256 characters, starting with a letter, and consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_).

Parameter reportSetting : Identifies the report template for the report. Reports are built using a report template. The report templates are:

RESOURCE_COMPLIANCE_REPORT | CONTROL_COMPLIANCE_REPORT | BACKUP_JOB_REPORT | COPY_JOB_REPORT | RESTORE_JOB_REPORT | SCAN_JOB_REPORT

If the report template is RESOURCE_COMPLIANCE_REPORT or CONTROL_COMPLIANCE_REPORT, this API resource also describes the report coverage by Amazon Web Services Regions and frameworks.

Parameter idempotencyToken : A customer-chosen string that you can use to distinguish between otherwise identical calls to CreateReportPlanInput. Retrying a successful request with the same idempotency token results in a success message with no action taken.

Parameter reportPlanDescription : An optional description of the report plan with a maximum of 1,024 characters.

Parameter reportPlanTags : The tags to assign to the report plan.

Implementation

Future<CreateReportPlanOutput> createReportPlan({
  required ReportDeliveryChannel reportDeliveryChannel,
  required String reportPlanName,
  required ReportSetting reportSetting,
  String? idempotencyToken,
  String? reportPlanDescription,
  Map<String, String>? reportPlanTags,
}) async {
  final $payload = <String, dynamic>{
    'ReportDeliveryChannel': reportDeliveryChannel,
    'ReportPlanName': reportPlanName,
    'ReportSetting': reportSetting,
    'IdempotencyToken': idempotencyToken ?? _s.generateIdempotencyToken(),
    if (reportPlanDescription != null)
      'ReportPlanDescription': reportPlanDescription,
    if (reportPlanTags != null) 'ReportPlanTags': reportPlanTags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/audit/report-plans',
    exceptionFnMap: _exceptionFns,
  );
  return CreateReportPlanOutput.fromJson(response);
}