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

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

  days?: number | core.NumberOut;

  storageClass: string | core.StringOut;
}

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

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

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

export interface TagArgs extends core.SchemaArgs {
  key: string | core.StringOut;

  value: string | core.StringOut;
}

export class Tag extends core.Schema<TagArgs> {
  @core.attr(String)
  public key!: string | core.StringOut;

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

export interface AndArgs extends core.SchemaArgs {
  objectSizeGreaterThan?: number | core.NumberOut;

  objectSizeLessThan?: number | core.NumberOut;

  prefix?: string | core.StringOut;

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

export class And extends core.Schema<AndArgs> {
  @core.attr(Number)
  public objectSizeGreaterThan?: number | core.NumberOut;

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

  @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 FilterArgs extends core.SchemaArgs {
  and?: And;

  objectSizeGreaterThan?: string | core.StringOut;

  objectSizeLessThan?: string | core.StringOut;

  prefix?: string | core.StringOut;

  tag?: Tag;
}

export class Filter extends core.Schema<FilterArgs> {
  @core.attr(And)
  public and?: And;

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

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

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

  @core.attr(Tag)
  public tag?: Tag;
}

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, { computed: true })
  public expiredObjectDeleteMarker?: boolean | core.BooleanOut;
}

export interface NoncurrentVersionTransitionArgs extends core.SchemaArgs {
  newerNoncurrentVersions?: string | core.StringOut;

  noncurrentDays?: number | core.NumberOut;

  storageClass: string | core.StringOut;
}

export class NoncurrentVersionTransition extends core.Schema<NoncurrentVersionTransitionArgs> {
  @core.attr(String)
  public newerNoncurrentVersions?: string | core.StringOut;

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

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

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 NoncurrentVersionExpirationArgs extends core.SchemaArgs {
  newerNoncurrentVersions?: string | core.StringOut;

  noncurrentDays?: number | core.NumberOut;
}

export class NoncurrentVersionExpiration extends core.Schema<NoncurrentVersionExpirationArgs> {
  @core.attr(String)
  public newerNoncurrentVersions?: string | core.StringOut;

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

export interface RuleArgs extends core.SchemaArgs {
  abortIncompleteMultipartUpload?: AbortIncompleteMultipartUpload;

  expiration?: Expiration;

  filter?: Filter;

  id: string | core.StringOut;

  noncurrentVersionExpiration?: NoncurrentVersionExpiration;

  noncurrentVersionTransition?:
    | core.Array<NoncurrentVersionTransition>
    | core.ArrayOut<NoncurrentVersionTransition>;

  prefix?: string | core.StringOut;

  status: string | core.StringOut;

  transition?: core.Array<Transition> | core.ArrayOut<Transition>;
}

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(NoncurrentVersionExpiration)
  public noncurrentVersionExpiration?: NoncurrentVersionExpiration;

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

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

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

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

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

  expectedBucketOwner?: 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)
  public expectedBucketOwner?: 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_s3_bucket_lifecycle_configuration", args);
  }

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