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

export interface PropertiesArgs extends core.SchemaArgs {
  description?: string | core.StringOut;

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

export class Properties extends core.Schema<PropertiesArgs> {
  @core.attr(String)
  public description?: string | core.StringOut;

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

export interface ThingTypeArgs extends core.ResourceArgs {
  deprecated?: boolean | core.BooleanOut;

  name: string | core.StringOut;

  properties?: Properties;

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

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

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

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

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

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

  @core.attr(Properties)
  public properties?: Properties;

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

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