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

export interface ThingArgs extends core.ResourceArgs {
  attributes?: core.Map<string, string> | core.MapOut<core.StringOut>;

  name: string | core.StringOut;

  thingTypeName?: string | core.StringOut;
}

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

  @core.attr(String, { kind: "map" })
  public attributes?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

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

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

  @core.attr(Number, { computed: true })
  public version!: number | core.NumberOut;

  constructor(name: string, args?: ThingArgs) {
    super(name, "aws_iot_thing", args);
  }

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