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

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 SizeConstraintsArgs extends core.SchemaArgs {
  comparisonOperator: string | core.StringOut;

  fieldToMatch: FieldToMatch;

  size: number | core.NumberOut;

  textTransformation: string | core.StringOut;
}

export class SizeConstraints extends core.Schema<SizeConstraintsArgs> {
  @core.attr(String)
  public comparisonOperator!: string | core.StringOut;

  @core.attr(FieldToMatch)
  public fieldToMatch!: FieldToMatch;

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

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

export interface SizeConstraintSetArgs extends core.ResourceArgs {
  name: string | core.StringOut;

  sizeConstraints?:
    | core.Array<SizeConstraints>
    | core.ArrayOut<SizeConstraints>;
}

export class SizeConstraintSet extends core.Resource<SizeConstraintSetArgs> {
  @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(SizeConstraints, { kind: "array" })
  public sizeConstraints?:
    | core.Array<SizeConstraints>
    | core.ArrayOut<SizeConstraints>;

  constructor(name: string, args?: SizeConstraintSetArgs) {
    super(name, "aws_wafregional_size_constraint_set", args);
  }

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