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 DsSpotPriceArgs {
  availabilityZone?: string | core.StringOut;

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

  instanceType?: string | core.StringOut;
}

export class DsSpotPrice extends core.Data<DsSpotPriceArgs> {
  @core.attr(String)
  public availabilityZone?: string | 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)
  public instanceType?: string | core.StringOut;

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

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

  constructor(name: string, args?: DsSpotPriceArgs) {
    super(name, "aws_ec2_spot_price", args);
  }

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