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

export interface UpstreamArgs extends core.SchemaArgs {
  repositoryName: string | core.StringOut;
}

export class Upstream extends core.Schema<UpstreamArgs> {
  @core.attr(String)
  public repositoryName!: string | core.StringOut;
}

export interface ExternalConnectionsArgs extends core.SchemaArgs {
  externalConnectionName: string | core.StringOut;

  packageFormat: string | core.StringOut;

  status: string | core.StringOut;
}

export class ExternalConnections extends core.Schema<ExternalConnectionsArgs> {
  @core.attr(String)
  public externalConnectionName!: string | core.StringOut;

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

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

export interface RepositoryArgs extends core.ResourceArgs {
  description?: string | core.StringOut;

  domain: string | core.StringOut;

  domainOwner?: string | core.StringOut;

  externalConnections?: ExternalConnections;

  repository: string | core.StringOut;

  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  upstream?: core.Array<Upstream> | core.ArrayOut<Upstream>;
}

export class Repository extends core.Resource<RepositoryArgs> {
  @core.attr(String, { computed: true })
  public administratorAccount!: string | core.StringOut;

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

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

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

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

  @core.attr(ExternalConnections)
  public externalConnections?: ExternalConnections;

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

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

  @core.attr(String, { kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

  constructor(name: string, args?: RepositoryArgs) {
    super(name, "aws_codeartifact_repository", args);
  }

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