import * as core from "@terrascript/core";

export interface LifecycleArgs extends core.SchemaArgs {
  coldStorageAfter?: number | core.NumberOut;

  deleteAfter?: number | core.NumberOut;
}

export class Lifecycle extends core.Schema<LifecycleArgs> {
  @core.attr(Number)
  public coldStorageAfter?: number | core.NumberOut;

  @core.attr(Number)
  public deleteAfter?: number | core.NumberOut;
}

export interface CopyActionArgs extends core.SchemaArgs {
  destinationVaultArn: string | core.StringOut;

  lifecycle?: Lifecycle;
}

export class CopyAction extends core.Schema<CopyActionArgs> {
  @core.attr(String)
  public destinationVaultArn!: string | core.StringOut;

  @core.attr(Lifecycle)
  public lifecycle?: Lifecycle;
}

export interface RuleArgs extends core.SchemaArgs {
  completionWindow?: number | core.NumberOut;

  copyAction?: core.Array<CopyAction> | core.ArrayOut<CopyAction>;

  enableContinuousBackup?: boolean | core.BooleanOut;

  lifecycle?: Lifecycle;

  recoveryPointTags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  ruleName: string | core.StringOut;

  schedule?: string | core.StringOut;

  startWindow?: number | core.NumberOut;

  targetVaultName: string | core.StringOut;
}

export class Rule extends core.Schema<RuleArgs> {
  @core.attr(Number)
  public completionWindow?: number | core.NumberOut;

  @core.attr(CopyAction, { kind: "array" })
  public copyAction?: core.Array<CopyAction> | core.ArrayOut<CopyAction>;

  @core.attr(Boolean)
  public enableContinuousBackup?: boolean | core.BooleanOut;

  @core.attr(Lifecycle)
  public lifecycle?: Lifecycle;

  @core.attr(String, { kind: "map" })
  public recoveryPointTags?:
    | core.Map<string, string>
    | core.MapOut<core.StringOut>;

  @core.attr(String)
  public ruleName!: string | core.StringOut;

  @core.attr(String)
  public schedule?: string | core.StringOut;

  @core.attr(Number)
  public startWindow?: number | core.NumberOut;

  @core.attr(String)
  public targetVaultName!: string | core.StringOut;
}

export interface AdvancedBackupSettingArgs extends core.SchemaArgs {
  backupOptions: core.Map<string, string> | core.MapOut<core.StringOut>;

  resourceType: string | core.StringOut;
}

export class AdvancedBackupSetting extends core.Schema<AdvancedBackupSettingArgs> {
  @core.attr(String, { kind: "map" })
  public backupOptions!: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(String)
  public resourceType!: string | core.StringOut;
}

export interface PlanArgs extends core.ResourceArgs {
  advancedBackupSetting?:
    | core.Array<AdvancedBackupSetting>
    | core.ArrayOut<AdvancedBackupSetting>;

  name: string | core.StringOut;

  rule: core.Array<Rule> | core.ArrayOut<Rule>;

  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;
}

export class Plan extends core.Resource<PlanArgs> {
  @core.attr(AdvancedBackupSetting, { kind: "array" })
  public advancedBackupSetting?:
    | core.Array<AdvancedBackupSetting>
    | core.ArrayOut<AdvancedBackupSetting>;

  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

  @core.attr(String)
  public name!: string | core.StringOut;

  @core.attr(Rule, { kind: "array" })
  public rule!: core.Array<Rule> | core.ArrayOut<Rule>;

  @core.attr(String, { kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(String, { computed: true, kind: "map" })
  public tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(String, { computed: true })
  public version!: string | core.StringOut;

  constructor(name: string, args?: PlanArgs) {
    super(name, "aws_backup_plan", args);
  }

  public override getNamespace(): string {
    return "aws_backup";
  }
}
