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

export interface VpcConfigurationArgs extends core.SchemaArgs {
  vpcId: string | core.StringOut;
}

export class VpcConfiguration extends core.Schema<VpcConfigurationArgs> {
  @core.attr(String)
  public vpcId!: string | core.StringOut;
}

export interface PublicAccessBlockConfigurationArgs extends core.SchemaArgs {
  blockPublicAcls?: boolean | core.BooleanOut;

  blockPublicPolicy?: boolean | core.BooleanOut;

  ignorePublicAcls?: boolean | core.BooleanOut;

  restrictPublicBuckets?: boolean | core.BooleanOut;
}

export class PublicAccessBlockConfiguration extends core.Schema<PublicAccessBlockConfigurationArgs> {
  @core.attr(Boolean)
  public blockPublicAcls?: boolean | core.BooleanOut;

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

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

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

export interface AccessPointArgs extends core.ResourceArgs {
  accountId?: string | core.StringOut;

  bucket: string | core.StringOut;

  name: string | core.StringOut;

  policy?: string | core.StringOut;

  publicAccessBlockConfiguration?: PublicAccessBlockConfiguration;

  vpcConfiguration?: VpcConfiguration;
}

export class AccessPoint extends core.Resource<AccessPointArgs> {
  @core.attr(String, { computed: true })
  public accountId?: string | core.StringOut;

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

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

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

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

  @core.attr(String, { computed: true, kind: "map" })
  public endpoints!: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(Boolean, { computed: true })
  public hasPublicAccessPolicy!: boolean | core.BooleanOut;

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

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

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

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

  @core.attr(PublicAccessBlockConfiguration)
  public publicAccessBlockConfiguration?: PublicAccessBlockConfiguration;

  @core.attr(VpcConfiguration)
  public vpcConfiguration?: VpcConfiguration;

  constructor(name: string, args?: AccessPointArgs) {
    super(name, "aws_s3_access_point", args);
  }

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