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

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

  blockPublicPolicy?: boolean | core.BooleanOut;

  ignorePublicAcls?: boolean | core.BooleanOut;

  restrictPublicBuckets?: boolean | core.BooleanOut;
}

export class PublicAccessBlock extends core.Schema<PublicAccessBlockArgs> {
  @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 RegionArgs extends core.SchemaArgs {
  bucket: string | core.StringOut;
}

export class Region extends core.Schema<RegionArgs> {
  @core.attr(String)
  public bucket!: string | core.StringOut;
}

export interface DetailsArgs extends core.SchemaArgs {
  name: string | core.StringOut;

  publicAccessBlock?: PublicAccessBlock;

  region: core.Array<Region> | core.ArrayOut<Region>;
}

export class Details extends core.Schema<DetailsArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;

  @core.attr(PublicAccessBlock)
  public publicAccessBlock?: PublicAccessBlock;

  @core.attr(Region, { kind: "array" })
  public region!: core.Array<Region> | core.ArrayOut<Region>;
}

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

  details: Details;
}

export class MultiRegionAccessPoint extends core.Resource<MultiRegionAccessPointArgs> {
  @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(Details)
  public details!: Details;

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

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

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

  constructor(name: string, args?: MultiRegionAccessPointArgs) {
    super(name, "aws_s3control_multi_region_access_point", args);
  }

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