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

export interface ScheduleArgs extends core.SchemaArgs {
  frequency: string | core.StringOut;
}

export class Schedule extends core.Schema<ScheduleArgs> {
  @core.attr(String)
  public frequency!: string | core.StringOut;
}

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

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

export interface SseKmsArgs extends core.SchemaArgs {
  keyId: string | core.StringOut;
}

export class SseKms extends core.Schema<SseKmsArgs> {
  @core.attr(String)
  public keyId!: string | core.StringOut;
}

export interface SseS3Args extends core.SchemaArgs {}

export class SseS3 extends core.Schema<SseS3Args> {}

export interface EncryptionArgs extends core.SchemaArgs {
  sseKms?: SseKms;

  sseS3?: SseS3;
}

export class Encryption extends core.Schema<EncryptionArgs> {
  @core.attr(SseKms)
  public sseKms?: SseKms;

  @core.attr(SseS3)
  public sseS3?: SseS3;
}

export interface BucketArgs extends core.SchemaArgs {
  accountId?: string | core.StringOut;

  bucketArn: string | core.StringOut;

  encryption?: Encryption;

  format: string | core.StringOut;

  prefix?: string | core.StringOut;
}

export class Bucket extends core.Schema<BucketArgs> {
  @core.attr(String)
  public accountId?: string | core.StringOut;

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

  @core.attr(Encryption)
  public encryption?: Encryption;

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

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

export interface DestinationArgs extends core.SchemaArgs {
  bucket: Bucket;
}

export class Destination extends core.Schema<DestinationArgs> {
  @core.attr(Bucket)
  public bucket!: Bucket;
}

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

  destination: Destination;

  enabled?: boolean | core.BooleanOut;

  filter?: Filter;

  includedObjectVersions: string | core.StringOut;

  name: string | core.StringOut;

  optionalFields?: core.Array<string> | core.ArrayOut<core.StringOut>;

  schedule: Schedule;
}

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

  @core.attr(Destination)
  public destination!: Destination;

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

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

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

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

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

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

  @core.attr(Schedule)
  public schedule!: Schedule;

  constructor(name: string, args?: BucketInventoryArgs) {
    super(name, "aws_s3_bucket_inventory", args);
  }

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