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

export interface ApplyServerSideEncryptionByDefaultArgs
  extends core.SchemaArgs {
  kmsMasterKeyId?: string | core.StringOut;

  sseAlgorithm: string | core.StringOut;
}

export class ApplyServerSideEncryptionByDefault extends core.Schema<ApplyServerSideEncryptionByDefaultArgs> {
  @core.attr(String)
  public kmsMasterKeyId?: string | core.StringOut;

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

export interface RuleArgs extends core.SchemaArgs {
  applyServerSideEncryptionByDefault?: ApplyServerSideEncryptionByDefault;

  bucketKeyEnabled?: boolean | core.BooleanOut;
}

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

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

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

  expectedBucketOwner?: string | core.StringOut;

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

export class BucketServerSideEncryptionConfiguration extends core.Resource<BucketServerSideEncryptionConfigurationArgs> {
  @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?: BucketServerSideEncryptionConfigurationArgs
  ) {
    super(name, "aws_s3_bucket_server_side_encryption_configuration", args);
  }

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