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

export interface RuleArgs extends core.SchemaArgs {
  objectOwnership: string | core.StringOut;
}

export class Rule extends core.Schema<RuleArgs> {
  @core.attr(String)
  public objectOwnership!: string | core.StringOut;
}

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

  rule: Rule;
}

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

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

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

  constructor(name: string, args?: BucketOwnershipControlsArgs) {
    super(name, "aws_s3_bucket_ownership_controls", args);
  }

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