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

export interface RuleConfigArgs extends core.SchemaArgs {
  inverted: boolean | core.BooleanOut;

  threshold: number | core.NumberOut;

  type: string | core.StringOut;
}

export class RuleConfig extends core.Schema<RuleConfigArgs> {
  @core.attr(Boolean)
  public inverted!: boolean | core.BooleanOut;

  @core.attr(Number)
  public threshold!: number | core.NumberOut;

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

export interface SafetyRuleArgs extends core.ResourceArgs {
  assertedControls?: core.Array<string> | core.ArrayOut<core.StringOut>;

  controlPanelArn: string | core.StringOut;

  gatingControls?: core.Array<string> | core.ArrayOut<core.StringOut>;

  name: string | core.StringOut;

  ruleConfig: RuleConfig;

  targetControls?: core.Array<string> | core.ArrayOut<core.StringOut>;

  waitPeriodMs: number | core.NumberOut;
}

export class SafetyRule extends core.Resource<SafetyRuleArgs> {
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  @core.attr(String, { kind: "array" })
  public assertedControls?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

  @core.attr(String, { kind: "array" })
  public gatingControls?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

  @core.attr(RuleConfig)
  public ruleConfig!: RuleConfig;

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

  @core.attr(String, { kind: "array" })
  public targetControls?: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(Number)
  public waitPeriodMs!: number | core.NumberOut;

  constructor(name: string, args?: SafetyRuleArgs) {
    super(name, "aws_route53recoverycontrolconfig_safety_rule", args);
  }

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