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

export interface GranteeArgs extends core.SchemaArgs {
  displayName: string | core.StringOut;

  emailAddress?: string | core.StringOut;

  id?: string | core.StringOut;

  type: string | core.StringOut;

  uri?: string | core.StringOut;
}

export class Grantee extends core.Schema<GranteeArgs> {
  @core.attr(String, { computed: true })
  public displayName!: string | core.StringOut;

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

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

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

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

export interface TargetGrantArgs extends core.SchemaArgs {
  grantee: Grantee;

  permission: string | core.StringOut;
}

export class TargetGrant extends core.Schema<TargetGrantArgs> {
  @core.attr(Grantee)
  public grantee!: Grantee;

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

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

  expectedBucketOwner?: string | core.StringOut;

  targetBucket: string | core.StringOut;

  targetGrant?: core.Array<TargetGrant> | core.ArrayOut<TargetGrant>;

  targetPrefix: string | core.StringOut;
}

export class BucketLogging extends core.Resource<BucketLoggingArgs> {
  @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 targetBucket!: string | core.StringOut;

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

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

  constructor(name: string, args?: BucketLoggingArgs) {
    super(name, "aws_s3_bucket_logging", args);
  }

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