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

export interface GitConfigArgs extends core.SchemaArgs {
  branch?: string | core.StringOut;

  repositoryUrl: string | core.StringOut;

  secretArn?: string | core.StringOut;
}

export class GitConfig extends core.Schema<GitConfigArgs> {
  @core.attr(String)
  public branch?: string | core.StringOut;

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

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

export interface CodeRepositoryArgs extends core.ResourceArgs {
  codeRepositoryName: string | core.StringOut;

  gitConfig: GitConfig;

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

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

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

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

  @core.attr(GitConfig)
  public gitConfig!: GitConfig;

  @core.attr(String, { computed: true })
  public id!: 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>;

  constructor(name: string, args?: CodeRepositoryArgs) {
    super(name, "aws_sagemaker_code_repository", args);
  }

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