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

export interface AbortIncompleteMultipartUploadArgs extends core.SchemaArgs {
  daysAfterInitiation: number | core.NumberOut;
}

export class AbortIncompleteMultipartUpload extends core.Schema<AbortIncompleteMultipartUploadArgs> {
  @core.attr(Number)
  public daysAfterInitiation!: number | core.NumberOut;
}

export interface ExpirationArgs extends core.SchemaArgs {
  date?: string | core.StringOut;

  days?: number | core.NumberOut;

  expiredObjectDeleteMarker?: boolean | core.BooleanOut;
}

export class Expiration extends core.Schema<ExpirationArgs> {
  @core.attr(String)
  public date?: string | core.StringOut;

  @core.attr(Number)
  public days?: number | core.NumberOut;

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

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 RuleArgs extends core.SchemaArgs {
  abortIncompleteMultipartUpload?: AbortIncompleteMultipartUpload;

  expiration?: Expiration;

  filter?: Filter;

  id: string | core.StringOut;

  status?: string | core.StringOut;
}

export class Rule extends core.Schema<RuleArgs> {
  @core.attr(AbortIncompleteMultipartUpload)
  public abortIncompleteMultipartUpload?: AbortIncompleteMultipartUpload;

  @core.attr(Expiration)
  public expiration?: Expiration;

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

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

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

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

  rule: core.Array<Rule> | core.ArrayOut<Rule>;
}

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

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

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

  constructor(name: string, args?: BucketLifecycleConfigurationArgs) {
    super(name, "aws_s3control_bucket_lifecycle_configuration", args);
  }

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