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

export interface AttributePayloadArgs extends core.SchemaArgs {
  attributes?: core.Map<string, string> | core.MapOut<core.StringOut>;
}

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

export interface PropertiesArgs extends core.SchemaArgs {
  attributePayload?: AttributePayload;

  description?: string | core.StringOut;
}

export class Properties extends core.Schema<PropertiesArgs> {
  @core.attr(AttributePayload)
  public attributePayload?: AttributePayload;

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

export interface RootToParentGroupsArgs extends core.SchemaArgs {
  groupArn: string | core.StringOut;

  groupName: string | core.StringOut;
}

export class RootToParentGroups extends core.Schema<RootToParentGroupsArgs> {
  @core.attr(String, { computed: true })
  public groupArn!: string | core.StringOut;

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

export interface MetadataArgs extends core.SchemaArgs {
  creationDate: string | core.StringOut;

  parentGroupName: string | core.StringOut;

  rootToParentGroups:
    | core.Array<RootToParentGroups>
    | core.ArrayOut<RootToParentGroups>;
}

export class Metadata extends core.Schema<MetadataArgs> {
  @core.attr(String, { computed: true })
  public creationDate!: string | core.StringOut;

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

  @core.attr(RootToParentGroups, { computed: true, kind: "array" })
  public rootToParentGroups!:
    | core.Array<RootToParentGroups>
    | core.ArrayOut<RootToParentGroups>;
}

export interface ThingGroupArgs extends core.ResourceArgs {
  name: string | core.StringOut;

  parentGroupName?: 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 ThingGroup extends core.Resource<ThingGroupArgs> {
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

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

  @core.attr(Metadata, { computed: true, kind: "array" })
  public metadata!: core.Array<Metadata> | core.ArrayOut<Metadata>;

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

  @core.attr(String)
  public parentGroupName?: 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>;

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

  constructor(name: string, args?: ThingGroupArgs) {
    super(name, "aws_iot_thing_group", args);
  }

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