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

export interface CriterionArgs extends core.SchemaArgs {
  equals?: core.Array<string> | core.ArrayOut<core.StringOut>;

  field: string | core.StringOut;

  greaterThan?: string | core.StringOut;

  greaterThanOrEqual?: string | core.StringOut;

  lessThan?: string | core.StringOut;

  lessThanOrEqual?: string | core.StringOut;

  notEquals?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class Criterion extends core.Schema<CriterionArgs> {
  @core.attr(String, { kind: "array" })
  public equals?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

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

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

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

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

export interface FindingCriteriaArgs extends core.SchemaArgs {
  criterion: core.Array<Criterion> | core.ArrayOut<Criterion>;
}

export class FindingCriteria extends core.Schema<FindingCriteriaArgs> {
  @core.attr(Criterion, { kind: "array" })
  public criterion!: core.Array<Criterion> | core.ArrayOut<Criterion>;
}

export interface FilterArgs extends core.ResourceArgs {
  action: string | core.StringOut;

  description?: string | core.StringOut;

  detectorId: string | core.StringOut;

  findingCriteria: FindingCriteria;

  name: string | core.StringOut;

  rank: number | core.NumberOut;

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

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

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

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

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

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

  @core.attr(FindingCriteria)
  public findingCriteria!: FindingCriteria;

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

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

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

  @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?: FilterArgs) {
    super(name, "aws_guardduty_filter", args);
  }

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