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

export interface FilterArgs extends core.SchemaArgs {
  prefix?: string | core.StringOut;

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

export class Filter extends core.Schema<FilterArgs> {
  @core.attr(String)
  public prefix?: string | core.StringOut;

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

export interface BucketMetricArgs extends core.ResourceArgs {
  bucket: string | core.StringOut;

  filter?: Filter;

  name: string | core.StringOut;
}

export class BucketMetric extends core.Resource<BucketMetricArgs> {
  @core.attr(String)
  public bucket!: string | core.StringOut;

  @core.attr(Filter)
  public filter?: Filter;

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

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

  constructor(name: string, args?: BucketMetricArgs) {
    super(name, "aws_s3_bucket_metric", args);
  }

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