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

export interface DefaultRetentionArgs extends core.SchemaArgs {
  days?: number | core.NumberOut;

  mode?: string | core.StringOut;

  years?: number | core.NumberOut;
}

export class DefaultRetention extends core.Schema<DefaultRetentionArgs> {
  @core.attr(Number)
  public days?: number | core.NumberOut;

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

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

export interface RuleArgs extends core.SchemaArgs {
  defaultRetention: DefaultRetention;
}

export class Rule extends core.Schema<RuleArgs> {
  @core.attr(DefaultRetention)
  public defaultRetention!: DefaultRetention;
}

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

  expectedBucketOwner?: string | core.StringOut;

  objectLockEnabled?: string | core.StringOut;

  rule: Rule;

  token?: string | core.StringOut;
}

export class BucketObjectLockConfiguration extends core.Resource<BucketObjectLockConfigurationArgs> {
  @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(String)
  public objectLockEnabled?: string | core.StringOut;

  @core.attr(Rule)
  public rule!: Rule;

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

  constructor(name: string, args?: BucketObjectLockConfigurationArgs) {
    super(name, "aws_s3_bucket_object_lock_configuration", args);
  }

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