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 DsInstanceTypeOfferingArgs {
  filter?: core.Array<Filter> | core.ArrayOut<Filter>;

  locationType?: string | core.StringOut;

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

export class DsInstanceTypeOffering extends core.Data<DsInstanceTypeOfferingArgs> {
  @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 })
  public instanceType!: string | core.StringOut;

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

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

  constructor(name: string, args?: DsInstanceTypeOfferingArgs) {
    super(name, "aws_ec2_instance_type_offering", args);
  }

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