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

export interface ActionArgs extends core.SchemaArgs {
  type: string | core.StringOut;
}

export class Action extends core.Schema<ActionArgs> {
  @core.attr(String)
  public type!: string | core.StringOut;
}

export interface ActivatedRuleArgs extends core.SchemaArgs {
  action: Action;

  priority: number | core.NumberOut;

  ruleId: string | core.StringOut;

  type?: string | core.StringOut;
}

export class ActivatedRule extends core.Schema<ActivatedRuleArgs> {
  @core.attr(Action)
  public action!: Action;

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

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

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

export interface RuleGroupArgs extends core.ResourceArgs {
  activatedRule?: core.Array<ActivatedRule> | core.ArrayOut<ActivatedRule>;

  metricName: string | core.StringOut;

  name: string | core.StringOut;

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

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

export class RuleGroup extends core.Resource<RuleGroupArgs> {
  @core.attr(ActivatedRule, { kind: "array" })
  public activatedRule?:
    | core.Array<ActivatedRule>
    | core.ArrayOut<ActivatedRule>;

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

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

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

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

  @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>;

  constructor(name: string, args?: RuleGroupArgs) {
    super(name, "aws_wafregional_rule_group", args);
  }

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