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

export interface EventSubscriptionArgs extends core.SchemaArgs {
  event: string | core.StringOut;

  topicArn: string | core.StringOut;
}

export class EventSubscription extends core.Schema<EventSubscriptionArgs> {
  @core.attr(String)
  public event!: string | core.StringOut;

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

export interface AssessmentTemplateArgs extends core.ResourceArgs {
  duration: number | core.NumberOut;

  eventSubscription?:
    | core.Array<EventSubscription>
    | core.ArrayOut<EventSubscription>;

  name: string | core.StringOut;

  rulesPackageArns: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

  targetArn: string | core.StringOut;
}

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

  @core.attr(Number)
  public duration!: number | core.NumberOut;

  @core.attr(EventSubscription, { kind: "array" })
  public eventSubscription?:
    | core.Array<EventSubscription>
    | core.ArrayOut<EventSubscription>;

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

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

  @core.attr(String, { kind: "array" })
  public rulesPackageArns!: core.Array<string> | core.ArrayOut<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 targetArn!: string | core.StringOut;

  constructor(name: string, args?: AssessmentTemplateArgs) {
    super(name, "aws_inspector_assessment_template", args);
  }

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