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

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

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

export interface FieldToMatchArgs extends core.SchemaArgs {
  data?: string | core.StringOut;

  type: string | core.StringOut;
}

export class FieldToMatch extends core.Schema<FieldToMatchArgs> {
  @core.attr(String)
  public data?: string | core.StringOut;

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

export interface RedactedFieldsArgs extends core.SchemaArgs {
  fieldToMatch: core.Array<FieldToMatch> | core.ArrayOut<FieldToMatch>;
}

export class RedactedFields extends core.Schema<RedactedFieldsArgs> {
  @core.attr(FieldToMatch, { kind: "array" })
  public fieldToMatch!: core.Array<FieldToMatch> | core.ArrayOut<FieldToMatch>;
}

export interface LoggingConfigurationArgs extends core.SchemaArgs {
  logDestination: string | core.StringOut;

  redactedFields?: RedactedFields;
}

export class LoggingConfiguration extends core.Schema<LoggingConfigurationArgs> {
  @core.attr(String)
  public logDestination!: string | core.StringOut;

  @core.attr(RedactedFields)
  public redactedFields?: RedactedFields;
}

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 OverrideActionArgs extends core.SchemaArgs {
  type: string | core.StringOut;
}

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

export interface RuleArgs extends core.SchemaArgs {
  action?: Action;

  overrideAction?: OverrideAction;

  priority: number | core.NumberOut;

  ruleId: string | core.StringOut;

  type?: string | core.StringOut;
}

export class Rule extends core.Schema<RuleArgs> {
  @core.attr(Action)
  public action?: Action;

  @core.attr(OverrideAction)
  public overrideAction?: OverrideAction;

  @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 WebAclArgs extends core.ResourceArgs {
  defaultAction: DefaultAction;

  loggingConfiguration?: LoggingConfiguration;

  metricName: string | core.StringOut;

  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 WebAcl extends core.Resource<WebAclArgs> {
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  @core.attr(DefaultAction)
  public defaultAction!: DefaultAction;

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

  @core.attr(LoggingConfiguration)
  public loggingConfiguration?: LoggingConfiguration;

  @core.attr(String)
  public metricName!: 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>;

  constructor(name: string, args?: WebAclArgs) {
    super(name, "aws_wafregional_web_acl", args);
  }

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