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

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

  id: string | core.StringOut;
}

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

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

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 GrantArgs extends core.SchemaArgs {
  grantee?: Grantee;

  permission: string | core.StringOut;
}

export class Grant extends core.Schema<GrantArgs> {
  @core.attr(Grantee)
  public grantee?: Grantee;

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

export interface AccessControlPolicyArgs extends core.SchemaArgs {
  grant?: core.Array<Grant> | core.ArrayOut<Grant>;

  owner: Owner;
}

export class AccessControlPolicy extends core.Schema<AccessControlPolicyArgs> {
  @core.attr(Grant, { kind: "array" })
  public grant?: core.Array<Grant> | core.ArrayOut<Grant>;

  @core.attr(Owner)
  public owner!: Owner;
}

export interface BucketAclArgs extends core.ResourceArgs {
  accessControlPolicy?: AccessControlPolicy;

  acl?: string | core.StringOut;

  bucket: string | core.StringOut;

  expectedBucketOwner?: string | core.StringOut;
}

export class BucketAcl extends core.Resource<BucketAclArgs> {
  @core.attr(AccessControlPolicy, { computed: true })
  public accessControlPolicy?: AccessControlPolicy;

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

  @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;

  constructor(name: string, args?: BucketAclArgs) {
    super(name, "aws_s3_bucket_acl", args);
  }

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