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

export interface RepositoryFilterArgs extends core.SchemaArgs {
  filter: string | core.StringOut;

  filterType: string | core.StringOut;
}

export class RepositoryFilter extends core.Schema<RepositoryFilterArgs> {
  @core.attr(String)
  public filter!: string | core.StringOut;

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

export interface RuleArgs extends core.SchemaArgs {
  repositoryFilter:
    | core.Array<RepositoryFilter>
    | core.ArrayOut<RepositoryFilter>;

  scanFrequency: string | core.StringOut;
}

export class Rule extends core.Schema<RuleArgs> {
  @core.attr(RepositoryFilter, { kind: "array" })
  public repositoryFilter!:
    | core.Array<RepositoryFilter>
    | core.ArrayOut<RepositoryFilter>;

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

export interface RegistryScanningConfigurationArgs extends core.ResourceArgs {
  rule?: core.Array<Rule> | core.ArrayOut<Rule>;

  scanType: string | core.StringOut;
}

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

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

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

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

  constructor(name: string, args?: RegistryScanningConfigurationArgs) {
    super(name, "aws_ecr_registry_scanning_configuration", args);
  }

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