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

export interface SubDomainArgs extends core.SchemaArgs {
  branchName: string | core.StringOut;

  dnsRecord: string | core.StringOut;

  prefix: string | core.StringOut;

  verified: boolean | core.BooleanOut;
}

export class SubDomain extends core.Schema<SubDomainArgs> {
  @core.attr(String)
  public branchName!: string | core.StringOut;

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

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

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

export interface DomainAssociationArgs extends core.ResourceArgs {
  appId: string | core.StringOut;

  domainName: string | core.StringOut;

  subDomain: core.Array<SubDomain> | core.ArrayOut<SubDomain>;

  waitForVerification?: boolean | core.BooleanOut;
}

export class DomainAssociation extends core.Resource<DomainAssociationArgs> {
  @core.attr(String)
  public appId!: string | core.StringOut;

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

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

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

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

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

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

  constructor(name: string, args?: DomainAssociationArgs) {
    super(name, "aws_amplify_domain_association", args);
  }

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