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

export interface SubscriberArgs extends core.SchemaArgs {
  address: string | core.StringOut;

  type: string | core.StringOut;
}

export class Subscriber extends core.Schema<SubscriberArgs> {
  @core.attr(String)
  public address!: string | core.StringOut;

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

export interface AnomalySubscriptionArgs extends core.ResourceArgs {
  accountId?: string | core.StringOut;

  frequency: string | core.StringOut;

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

  name: string | core.StringOut;

  subscriber: core.Array<Subscriber> | core.ArrayOut<Subscriber>;

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

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

  threshold: number | core.NumberOut;
}

export class AnomalySubscription extends core.Resource<AnomalySubscriptionArgs> {
  @core.attr(String, { computed: true })
  public accountId?: string | core.StringOut;

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

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

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

  @core.attr(String, { kind: "array" })
  public monitorArnList!: core.Array<string> | core.ArrayOut<core.StringOut>;

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

  @core.attr(Subscriber, { kind: "array" })
  public subscriber!: core.Array<Subscriber> | core.ArrayOut<Subscriber>;

  @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)
  public threshold!: number | core.NumberOut;

  constructor(name: string, args?: AnomalySubscriptionArgs) {
    super(name, "aws_ce_anomaly_subscription", args);
  }

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