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

export interface PreProvisioningHookArgs extends core.SchemaArgs {
  payloadVersion?: string | core.StringOut;

  targetArn: string | core.StringOut;
}

export class PreProvisioningHook extends core.Schema<PreProvisioningHookArgs> {
  @core.attr(String)
  public payloadVersion?: string | core.StringOut;

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

export interface ProvisioningTemplateArgs extends core.ResourceArgs {
  description?: string | core.StringOut;

  enabled?: boolean | core.BooleanOut;

  name: string | core.StringOut;

  preProvisioningHook?: PreProvisioningHook;

  provisioningRoleArn: string | core.StringOut;

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

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

  templateBody: string | core.StringOut;
}

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

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

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

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

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

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

  @core.attr(PreProvisioningHook)
  public preProvisioningHook?: PreProvisioningHook;

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

  @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(String)
  public templateBody!: string | core.StringOut;

  constructor(name: string, args?: ProvisioningTemplateArgs) {
    super(name, "aws_iot_provisioning_template", args);
  }

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