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

export interface ActionConditionArgs extends core.SchemaArgs {
  action: string | core.StringOut;
}

export class ActionCondition extends core.Schema<ActionConditionArgs> {
  @core.attr(String)
  public action!: string | core.StringOut;
}

export interface LabelNameConditionArgs extends core.SchemaArgs {
  labelName: string | core.StringOut;
}

export class LabelNameCondition extends core.Schema<LabelNameConditionArgs> {
  @core.attr(String)
  public labelName!: string | core.StringOut;
}

export interface ConditionArgs extends core.SchemaArgs {
  actionCondition?: ActionCondition;

  labelNameCondition?: LabelNameCondition;
}

export class Condition extends core.Schema<ConditionArgs> {
  @core.attr(ActionCondition)
  public actionCondition?: ActionCondition;

  @core.attr(LabelNameCondition)
  public labelNameCondition?: LabelNameCondition;
}

export interface FilterArgs extends core.SchemaArgs {
  behavior: string | core.StringOut;

  condition: core.Array<Condition> | core.ArrayOut<Condition>;

  requirement: string | core.StringOut;
}

export class Filter extends core.Schema<FilterArgs> {
  @core.attr(String)
  public behavior!: string | core.StringOut;

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

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

export interface LoggingFilterArgs extends core.SchemaArgs {
  defaultBehavior: string | core.StringOut;

  filter: core.Array<Filter> | core.ArrayOut<Filter>;
}

export class LoggingFilter extends core.Schema<LoggingFilterArgs> {
  @core.attr(String)
  public defaultBehavior!: string | core.StringOut;

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

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 RedactedFieldsArgs extends core.SchemaArgs {
  allQueryArguments?: AllQueryArguments;

  body?: Body;

  method?: Method;

  queryString?: QueryString;

  singleHeader?: SingleHeader;

  singleQueryArgument?: SingleQueryArgument;

  uriPath?: UriPath;
}

export class RedactedFields extends core.Schema<RedactedFieldsArgs> {
  @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 V2WebAclLoggingConfigurationArgs extends core.ResourceArgs {
  logDestinationConfigs: core.Array<string> | core.ArrayOut<core.StringOut>;

  loggingFilter?: LoggingFilter;

  redactedFields?: core.Array<RedactedFields> | core.ArrayOut<RedactedFields>;

  resourceArn: string | core.StringOut;
}

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

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

  @core.attr(LoggingFilter)
  public loggingFilter?: LoggingFilter;

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

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

  constructor(name: string, args?: V2WebAclLoggingConfigurationArgs) {
    super(name, "aws_wafv2_web_acl_logging_configuration", args);
  }

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