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

export interface EncryptionConfigurationArgs extends core.SchemaArgs {
  encryptionType?: string | core.StringOut;

  kmsKey?: string | core.StringOut;
}

export class EncryptionConfiguration extends core.Schema<EncryptionConfigurationArgs> {
  @core.attr(String)
  public encryptionType?: string | core.StringOut;

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

export interface ImageScanningConfigurationArgs extends core.SchemaArgs {
  scanOnPush: boolean | core.BooleanOut;
}

export class ImageScanningConfiguration extends core.Schema<ImageScanningConfigurationArgs> {
  @core.attr(Boolean)
  public scanOnPush!: boolean | core.BooleanOut;
}

export interface RepositoryArgs extends core.ResourceArgs {
  encryptionConfiguration?:
    | core.Array<EncryptionConfiguration>
    | core.ArrayOut<EncryptionConfiguration>;

  forceDelete?: boolean | core.BooleanOut;

  imageScanningConfiguration?: ImageScanningConfiguration;

  imageTagMutability?: string | core.StringOut;

  name: string | core.StringOut;

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

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

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

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

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

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

  @core.attr(ImageScanningConfiguration)
  public imageScanningConfiguration?: ImageScanningConfiguration;

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

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

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

  @core.attr(String, { computed: true })
  public repositoryUrl!: 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?: RepositoryArgs) {
    super(name, "aws_ecr_repository", args);
  }

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