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

export interface CustomResponseBodyArgs extends core.SchemaArgs {
  content: string | core.StringOut;

  contentType: string | core.StringOut;

  key: string | core.StringOut;
}

export class CustomResponseBody extends core.Schema<CustomResponseBodyArgs> {
  @core.attr(String)
  public content!: string | core.StringOut;

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

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

export interface VisibilityConfigArgs extends core.SchemaArgs {
  cloudwatchMetricsEnabled: boolean | core.BooleanOut;

  metricName: string | core.StringOut;

  sampledRequestsEnabled: boolean | core.BooleanOut;
}

export class VisibilityConfig extends core.Schema<VisibilityConfigArgs> {
  @core.attr(Boolean)
  public cloudwatchMetricsEnabled!: boolean | core.BooleanOut;

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

  @core.attr(Boolean)
  public sampledRequestsEnabled!: boolean | core.BooleanOut;
}

export interface InsertHeaderArgs extends core.SchemaArgs {
  name: string | core.StringOut;

  value: string | core.StringOut;
}

export class InsertHeader extends core.Schema<InsertHeaderArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;

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

export interface CustomRequestHandlingArgs extends core.SchemaArgs {
  insertHeader: core.Array<InsertHeader> | core.ArrayOut<InsertHeader>;
}

export class CustomRequestHandling extends core.Schema<CustomRequestHandlingArgs> {
  @core.attr(InsertHeader, { kind: "array" })
  public insertHeader!: core.Array<InsertHeader> | core.ArrayOut<InsertHeader>;
}

export interface AllowArgs extends core.SchemaArgs {
  customRequestHandling?: CustomRequestHandling;
}

export class Allow extends core.Schema<AllowArgs> {
  @core.attr(CustomRequestHandling)
  public customRequestHandling?: CustomRequestHandling;
}

export interface ResponseHeaderArgs extends core.SchemaArgs {
  name: string | core.StringOut;

  value: string | core.StringOut;
}

export class ResponseHeader extends core.Schema<ResponseHeaderArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;

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

export interface CustomResponseArgs extends core.SchemaArgs {
  customResponseBodyKey?: string | core.StringOut;

  responseCode: number | core.NumberOut;

  responseHeader?: core.Array<ResponseHeader> | core.ArrayOut<ResponseHeader>;
}

export class CustomResponse extends core.Schema<CustomResponseArgs> {
  @core.attr(String)
  public customResponseBodyKey?: string | core.StringOut;

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

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

export interface BlockArgs extends core.SchemaArgs {
  customResponse?: CustomResponse;
}

export class Block extends core.Schema<BlockArgs> {
  @core.attr(CustomResponse)
  public customResponse?: CustomResponse;
}

export interface CountArgs extends core.SchemaArgs {
  customRequestHandling?: CustomRequestHandling;
}

export class Count extends core.Schema<CountArgs> {
  @core.attr(CustomRequestHandling)
  public customRequestHandling?: CustomRequestHandling;
}

export interface ActionArgs extends core.SchemaArgs {
  allow?: Allow;

  block?: Block;

  count?: Count;
}

export class Action extends core.Schema<ActionArgs> {
  @core.attr(Allow)
  public allow?: Allow;

  @core.attr(Block)
  public block?: Block;

  @core.attr(Count)
  public count?: Count;
}

export interface RuleLabelArgs extends core.SchemaArgs {
  name: string | core.StringOut;
}

export class RuleLabel extends core.Schema<RuleLabelArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;
}

export interface AllQueryArgumentsArgs extends core.SchemaArgs {}

export class AllQueryArguments extends core.Schema<AllQueryArgumentsArgs> {}

export interface BodyArgs extends core.SchemaArgs {}

export class Body extends core.Schema<BodyArgs> {}

export interface MethodArgs extends core.SchemaArgs {}

export class Method extends core.Schema<MethodArgs> {}

export interface QueryStringArgs extends core.SchemaArgs {}

export class QueryString extends core.Schema<QueryStringArgs> {}

export interface SingleHeaderArgs extends core.SchemaArgs {
  name: string | core.StringOut;
}

export class SingleHeader extends core.Schema<SingleHeaderArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;
}

export interface SingleQueryArgumentArgs extends core.SchemaArgs {
  name: string | core.StringOut;
}

export class SingleQueryArgument extends core.Schema<SingleQueryArgumentArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;
}

export interface UriPathArgs extends core.SchemaArgs {}

export class UriPath extends core.Schema<UriPathArgs> {}

export interface FieldToMatchArgs extends core.SchemaArgs {
  allQueryArguments?: AllQueryArguments;

  body?: Body;

  method?: Method;

  queryString?: QueryString;

  singleHeader?: SingleHeader;

  singleQueryArgument?: SingleQueryArgument;

  uriPath?: UriPath;
}

export class FieldToMatch extends core.Schema<FieldToMatchArgs> {
  @core.attr(AllQueryArguments)
  public allQueryArguments?: AllQueryArguments;

  @core.attr(Body)
  public body?: Body;

  @core.attr(Method)
  public method?: Method;

  @core.attr(QueryString)
  public queryString?: QueryString;

  @core.attr(SingleHeader)
  public singleHeader?: SingleHeader;

  @core.attr(SingleQueryArgument)
  public singleQueryArgument?: SingleQueryArgument;

  @core.attr(UriPath)
  public uriPath?: UriPath;
}

export interface TextTransformationArgs extends core.SchemaArgs {
  priority: number | core.NumberOut;

  type: string | core.StringOut;
}

export class TextTransformation extends core.Schema<TextTransformationArgs> {
  @core.attr(Number)
  public priority!: number | core.NumberOut;

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

export interface RegexPatternSetReferenceStatementArgs extends core.SchemaArgs {
  arn: string | core.StringOut;

  fieldToMatch?: FieldToMatch;

  textTransformation:
    | core.Array<TextTransformation>
    | core.ArrayOut<TextTransformation>;
}

export class RegexPatternSetReferenceStatement extends core.Schema<RegexPatternSetReferenceStatementArgs> {
  @core.attr(String)
  public arn!: string | core.StringOut;

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

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

export interface SizeConstraintStatementArgs extends core.SchemaArgs {
  comparisonOperator: string | core.StringOut;

  fieldToMatch?: FieldToMatch;

  size: number | core.NumberOut;

  textTransformation:
    | core.Array<TextTransformation>
    | core.ArrayOut<TextTransformation>;
}

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

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

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

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

export interface SqliMatchStatementArgs extends core.SchemaArgs {
  fieldToMatch?: FieldToMatch;

  textTransformation:
    | core.Array<TextTransformation>
    | core.ArrayOut<TextTransformation>;
}

export class SqliMatchStatement extends core.Schema<SqliMatchStatementArgs> {
  @core.attr(FieldToMatch)
  public fieldToMatch?: FieldToMatch;

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

export interface ByteMatchStatementArgs extends core.SchemaArgs {
  fieldToMatch?: FieldToMatch;

  positionalConstraint: string | core.StringOut;

  searchString: string | core.StringOut;

  textTransformation:
    | core.Array<TextTransformation>
    | core.ArrayOut<TextTransformation>;
}

export class ByteMatchStatement extends core.Schema<ByteMatchStatementArgs> {
  @core.attr(FieldToMatch)
  public fieldToMatch?: FieldToMatch;

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

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

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

export interface XssMatchStatementArgs extends core.SchemaArgs {
  fieldToMatch?: FieldToMatch;

  textTransformation:
    | core.Array<TextTransformation>
    | core.ArrayOut<TextTransformation>;
}

export class XssMatchStatement extends core.Schema<XssMatchStatementArgs> {
  @core.attr(FieldToMatch)
  public fieldToMatch?: FieldToMatch;

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

export interface IpSetForwardedIpConfigArgs extends core.SchemaArgs {
  fallbackBehavior: string | core.StringOut;

  headerName: string | core.StringOut;

  position: string | core.StringOut;
}

export class IpSetForwardedIpConfig extends core.Schema<IpSetForwardedIpConfigArgs> {
  @core.attr(String)
  public fallbackBehavior!: string | core.StringOut;

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

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

export interface IpSetReferenceStatementArgs extends core.SchemaArgs {
  arn: string | core.StringOut;

  ipSetForwardedIpConfig?: IpSetForwardedIpConfig;
}

export class IpSetReferenceStatement extends core.Schema<IpSetReferenceStatementArgs> {
  @core.attr(String)
  public arn!: string | core.StringOut;

  @core.attr(IpSetForwardedIpConfig)
  public ipSetForwardedIpConfig?: IpSetForwardedIpConfig;
}

export interface LabelMatchStatementArgs extends core.SchemaArgs {
  key: string | core.StringOut;

  scope: string | core.StringOut;
}

export class LabelMatchStatement extends core.Schema<LabelMatchStatementArgs> {
  @core.attr(String)
  public key!: string | core.StringOut;

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

export interface ForwardedIpConfigArgs extends core.SchemaArgs {
  fallbackBehavior: string | core.StringOut;

  headerName: string | core.StringOut;
}

export class ForwardedIpConfig extends core.Schema<ForwardedIpConfigArgs> {
  @core.attr(String)
  public fallbackBehavior!: string | core.StringOut;

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

export interface GeoMatchStatementArgs extends core.SchemaArgs {
  countryCodes: core.Array<string> | core.ArrayOut<core.StringOut>;

  forwardedIpConfig?: ForwardedIpConfig;
}

export class GeoMatchStatement extends core.Schema<GeoMatchStatementArgs> {
  @core.attr(String, { kind: "array" })
  public countryCodes!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(ForwardedIpConfig)
  public forwardedIpConfig?: ForwardedIpConfig;
}

export interface RuleStatementOrStatementStatementAndStatementStatementArgs
  extends core.SchemaArgs {
  byteMatchStatement?: ByteMatchStatement;

  geoMatchStatement?: GeoMatchStatement;

  ipSetReferenceStatement?: IpSetReferenceStatement;

  labelMatchStatement?: LabelMatchStatement;

  regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement;

  sizeConstraintStatement?: SizeConstraintStatement;

  sqliMatchStatement?: SqliMatchStatement;

  xssMatchStatement?: XssMatchStatement;
}

export class RuleStatementOrStatementStatementAndStatementStatement extends core.Schema<RuleStatementOrStatementStatementAndStatementStatementArgs> {
  @core.attr(ByteMatchStatement)
  public byteMatchStatement?: ByteMatchStatement;

  @core.attr(GeoMatchStatement)
  public geoMatchStatement?: GeoMatchStatement;

  @core.attr(IpSetReferenceStatement)
  public ipSetReferenceStatement?: IpSetReferenceStatement;

  @core.attr(LabelMatchStatement)
  public labelMatchStatement?: LabelMatchStatement;

  @core.attr(RegexPatternSetReferenceStatement)
  public regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement;

  @core.attr(SizeConstraintStatement)
  public sizeConstraintStatement?: SizeConstraintStatement;

  @core.attr(SqliMatchStatement)
  public sqliMatchStatement?: SqliMatchStatement;

  @core.attr(XssMatchStatement)
  public xssMatchStatement?: XssMatchStatement;
}

export interface RuleStatementOrStatementStatementAndStatementArgs
  extends core.SchemaArgs {
  statement:
    | core.Array<RuleStatementOrStatementStatementAndStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatementAndStatementStatement>;
}

export class RuleStatementOrStatementStatementAndStatement extends core.Schema<RuleStatementOrStatementStatementAndStatementArgs> {
  @core.attr(RuleStatementOrStatementStatementAndStatementStatement, {
    kind: "array",
  })
  public statement!:
    | core.Array<RuleStatementOrStatementStatementAndStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatementAndStatementStatement>;
}

export interface RuleStatementOrStatementStatementNotStatementArgs
  extends core.SchemaArgs {
  statement:
    | core.Array<RuleStatementOrStatementStatementAndStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatementAndStatementStatement>;
}

export class RuleStatementOrStatementStatementNotStatement extends core.Schema<RuleStatementOrStatementStatementNotStatementArgs> {
  @core.attr(RuleStatementOrStatementStatementAndStatementStatement, {
    kind: "array",
  })
  public statement!:
    | core.Array<RuleStatementOrStatementStatementAndStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatementAndStatementStatement>;
}

export interface RuleStatementOrStatementStatementOrStatementArgs
  extends core.SchemaArgs {
  statement:
    | core.Array<RuleStatementOrStatementStatementAndStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatementAndStatementStatement>;
}

export class RuleStatementOrStatementStatementOrStatement extends core.Schema<RuleStatementOrStatementStatementOrStatementArgs> {
  @core.attr(RuleStatementOrStatementStatementAndStatementStatement, {
    kind: "array",
  })
  public statement!:
    | core.Array<RuleStatementOrStatementStatementAndStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatementAndStatementStatement>;
}

export interface RuleStatementOrStatementStatementArgs extends core.SchemaArgs {
  andStatement?: RuleStatementOrStatementStatementAndStatement;

  byteMatchStatement?: ByteMatchStatement;

  geoMatchStatement?: GeoMatchStatement;

  ipSetReferenceStatement?: IpSetReferenceStatement;

  labelMatchStatement?: LabelMatchStatement;

  notStatement?: RuleStatementOrStatementStatementNotStatement;

  orStatement?: RuleStatementOrStatementStatementOrStatement;

  regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement;

  sizeConstraintStatement?: SizeConstraintStatement;

  sqliMatchStatement?: SqliMatchStatement;

  xssMatchStatement?: XssMatchStatement;
}

export class RuleStatementOrStatementStatement extends core.Schema<RuleStatementOrStatementStatementArgs> {
  @core.attr(RuleStatementOrStatementStatementAndStatement)
  public andStatement?: RuleStatementOrStatementStatementAndStatement;

  @core.attr(ByteMatchStatement)
  public byteMatchStatement?: ByteMatchStatement;

  @core.attr(GeoMatchStatement)
  public geoMatchStatement?: GeoMatchStatement;

  @core.attr(IpSetReferenceStatement)
  public ipSetReferenceStatement?: IpSetReferenceStatement;

  @core.attr(LabelMatchStatement)
  public labelMatchStatement?: LabelMatchStatement;

  @core.attr(RuleStatementOrStatementStatementNotStatement)
  public notStatement?: RuleStatementOrStatementStatementNotStatement;

  @core.attr(RuleStatementOrStatementStatementOrStatement)
  public orStatement?: RuleStatementOrStatementStatementOrStatement;

  @core.attr(RegexPatternSetReferenceStatement)
  public regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement;

  @core.attr(SizeConstraintStatement)
  public sizeConstraintStatement?: SizeConstraintStatement;

  @core.attr(SqliMatchStatement)
  public sqliMatchStatement?: SqliMatchStatement;

  @core.attr(XssMatchStatement)
  public xssMatchStatement?: XssMatchStatement;
}

export interface RuleStatementOrStatementArgs extends core.SchemaArgs {
  statement:
    | core.Array<RuleStatementOrStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatement>;
}

export class RuleStatementOrStatement extends core.Schema<RuleStatementOrStatementArgs> {
  @core.attr(RuleStatementOrStatementStatement, { kind: "array" })
  public statement!:
    | core.Array<RuleStatementOrStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatement>;
}

export interface RuleStatementAndStatementArgs extends core.SchemaArgs {
  statement:
    | core.Array<RuleStatementOrStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatement>;
}

export class RuleStatementAndStatement extends core.Schema<RuleStatementAndStatementArgs> {
  @core.attr(RuleStatementOrStatementStatement, { kind: "array" })
  public statement!:
    | core.Array<RuleStatementOrStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatement>;
}

export interface RuleStatementNotStatementArgs extends core.SchemaArgs {
  statement:
    | core.Array<RuleStatementOrStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatement>;
}

export class RuleStatementNotStatement extends core.Schema<RuleStatementNotStatementArgs> {
  @core.attr(RuleStatementOrStatementStatement, { kind: "array" })
  public statement!:
    | core.Array<RuleStatementOrStatementStatement>
    | core.ArrayOut<RuleStatementOrStatementStatement>;
}

export interface RuleStatementArgs extends core.SchemaArgs {
  andStatement?: RuleStatementAndStatement;

  byteMatchStatement?: ByteMatchStatement;

  geoMatchStatement?: GeoMatchStatement;

  ipSetReferenceStatement?: IpSetReferenceStatement;

  labelMatchStatement?: LabelMatchStatement;

  notStatement?: RuleStatementNotStatement;

  orStatement?: RuleStatementOrStatement;

  regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement;

  sizeConstraintStatement?: SizeConstraintStatement;

  sqliMatchStatement?: SqliMatchStatement;

  xssMatchStatement?: XssMatchStatement;
}

export class RuleStatement extends core.Schema<RuleStatementArgs> {
  @core.attr(RuleStatementAndStatement)
  public andStatement?: RuleStatementAndStatement;

  @core.attr(ByteMatchStatement)
  public byteMatchStatement?: ByteMatchStatement;

  @core.attr(GeoMatchStatement)
  public geoMatchStatement?: GeoMatchStatement;

  @core.attr(IpSetReferenceStatement)
  public ipSetReferenceStatement?: IpSetReferenceStatement;

  @core.attr(LabelMatchStatement)
  public labelMatchStatement?: LabelMatchStatement;

  @core.attr(RuleStatementNotStatement)
  public notStatement?: RuleStatementNotStatement;

  @core.attr(RuleStatementOrStatement)
  public orStatement?: RuleStatementOrStatement;

  @core.attr(RegexPatternSetReferenceStatement)
  public regexPatternSetReferenceStatement?: RegexPatternSetReferenceStatement;

  @core.attr(SizeConstraintStatement)
  public sizeConstraintStatement?: SizeConstraintStatement;

  @core.attr(SqliMatchStatement)
  public sqliMatchStatement?: SqliMatchStatement;

  @core.attr(XssMatchStatement)
  public xssMatchStatement?: XssMatchStatement;
}

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

  name: string | core.StringOut;

  priority: number | core.NumberOut;

  ruleLabel?: core.Array<RuleLabel> | core.ArrayOut<RuleLabel>;

  statement: RuleStatement;

  visibilityConfig: VisibilityConfig;
}

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

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

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

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

  @core.attr(RuleStatement)
  public statement!: RuleStatement;

  @core.attr(VisibilityConfig)
  public visibilityConfig!: VisibilityConfig;
}

export interface V2RuleGroupArgs extends core.ResourceArgs {
  capacity: number | core.NumberOut;

  customResponseBody?:
    | core.Array<CustomResponseBody>
    | core.ArrayOut<CustomResponseBody>;

  description?: string | core.StringOut;

  name: string | core.StringOut;

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

  scope: string | core.StringOut;

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

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

  visibilityConfig: VisibilityConfig;
}

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

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

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

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

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

  @core.attr(String, { computed: true })
  public lockToken!: 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)
  public scope!: 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>;

  @core.attr(VisibilityConfig)
  public visibilityConfig!: VisibilityConfig;

  constructor(name: string, args?: V2RuleGroupArgs) {
    super(name, "aws_wafv2_rule_group", args);
  }

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