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

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

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

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

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

export interface DsAmiIdsArgs {
  executableUsers?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

  nameRegex?: string | core.StringOut;

  owners: core.Array<string> | core.ArrayOut<core.StringOut>;

  sortAscending?: boolean | core.BooleanOut;
}

export class DsAmiIds extends core.Data<DsAmiIdsArgs> {
  @core.attr(String, { kind: "array" })
  public executableUsers?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

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

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

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

  @core.attr(Boolean)
  public sortAscending?: boolean | core.BooleanOut;

  constructor(name: string, args?: DsAmiIdsArgs) {
    super(name, "aws_ami_ids", args);
  }

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