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

export interface RelevanceArgs extends core.SchemaArgs {
  duration?: string | core.StringOut;

  freshness?: boolean | core.BooleanOut;

  importance?: number | core.NumberOut;

  rankOrder?: string | core.StringOut;

  valuesImportanceMap?: core.Map<string, number> | core.MapOut<core.NumberOut>;
}

export class Relevance extends core.Schema<RelevanceArgs> {
  @core.attr(String, { computed: true })
  public duration?: string | core.StringOut;

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

  @core.attr(Number, { computed: true })
  public importance?: number | core.NumberOut;

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

  @core.attr(Number, { computed: true, kind: "map" })
  public valuesImportanceMap?:
    | core.Map<string, number>
    | core.MapOut<core.NumberOut>;
}

export interface SearchArgs extends core.SchemaArgs {
  displayable?: boolean | core.BooleanOut;

  facetable?: boolean | core.BooleanOut;

  searchable?: boolean | core.BooleanOut;

  sortable?: boolean | core.BooleanOut;
}

export class Search extends core.Schema<SearchArgs> {
  @core.attr(Boolean, { computed: true })
  public displayable?: boolean | core.BooleanOut;

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

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

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

export interface DocumentMetadataConfigurationUpdatesArgs
  extends core.SchemaArgs {
  name: string | core.StringOut;

  relevance?: Relevance;

  search?: Search;

  type: string | core.StringOut;
}

export class DocumentMetadataConfigurationUpdates extends core.Schema<DocumentMetadataConfigurationUpdatesArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;

  @core.attr(Relevance, { computed: true })
  public relevance?: Relevance;

  @core.attr(Search, { computed: true })
  public search?: Search;

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

export interface UserGroupResolutionConfigurationArgs extends core.SchemaArgs {
  userGroupResolutionMode: string | core.StringOut;
}

export class UserGroupResolutionConfiguration extends core.Schema<UserGroupResolutionConfigurationArgs> {
  @core.attr(String)
  public userGroupResolutionMode!: string | core.StringOut;
}

export interface JsonTokenTypeConfigurationArgs extends core.SchemaArgs {
  groupAttributeField: string | core.StringOut;

  userNameAttributeField: string | core.StringOut;
}

export class JsonTokenTypeConfiguration extends core.Schema<JsonTokenTypeConfigurationArgs> {
  @core.attr(String)
  public groupAttributeField!: string | core.StringOut;

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

export interface JwtTokenTypeConfigurationArgs extends core.SchemaArgs {
  claimRegex?: string | core.StringOut;

  groupAttributeField?: string | core.StringOut;

  issuer?: string | core.StringOut;

  keyLocation: string | core.StringOut;

  secretsManagerArn?: string | core.StringOut;

  url?: string | core.StringOut;

  userNameAttributeField?: string | core.StringOut;
}

export class JwtTokenTypeConfiguration extends core.Schema<JwtTokenTypeConfigurationArgs> {
  @core.attr(String)
  public claimRegex?: string | core.StringOut;

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

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

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

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

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

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

export interface UserTokenConfigurationsArgs extends core.SchemaArgs {
  jsonTokenTypeConfiguration?: JsonTokenTypeConfiguration;

  jwtTokenTypeConfiguration?: JwtTokenTypeConfiguration;
}

export class UserTokenConfigurations extends core.Schema<UserTokenConfigurationsArgs> {
  @core.attr(JsonTokenTypeConfiguration)
  public jsonTokenTypeConfiguration?: JsonTokenTypeConfiguration;

  @core.attr(JwtTokenTypeConfiguration)
  public jwtTokenTypeConfiguration?: JwtTokenTypeConfiguration;
}

export interface FaqStatisticsArgs extends core.SchemaArgs {
  indexedQuestionAnswersCount: number | core.NumberOut;
}

export class FaqStatistics extends core.Schema<FaqStatisticsArgs> {
  @core.attr(Number, { computed: true })
  public indexedQuestionAnswersCount!: number | core.NumberOut;
}

export interface TextDocumentStatisticsArgs extends core.SchemaArgs {
  indexedTextBytes: number | core.NumberOut;

  indexedTextDocumentsCount: number | core.NumberOut;
}

export class TextDocumentStatistics extends core.Schema<TextDocumentStatisticsArgs> {
  @core.attr(Number, { computed: true })
  public indexedTextBytes!: number | core.NumberOut;

  @core.attr(Number, { computed: true })
  public indexedTextDocumentsCount!: number | core.NumberOut;
}

export interface IndexStatisticsArgs extends core.SchemaArgs {
  faqStatistics: core.Array<FaqStatistics> | core.ArrayOut<FaqStatistics>;

  textDocumentStatistics:
    | core.Array<TextDocumentStatistics>
    | core.ArrayOut<TextDocumentStatistics>;
}

export class IndexStatistics extends core.Schema<IndexStatisticsArgs> {
  @core.attr(FaqStatistics, { computed: true, kind: "array" })
  public faqStatistics!:
    | core.Array<FaqStatistics>
    | core.ArrayOut<FaqStatistics>;

  @core.attr(TextDocumentStatistics, { computed: true, kind: "array" })
  public textDocumentStatistics!:
    | core.Array<TextDocumentStatistics>
    | core.ArrayOut<TextDocumentStatistics>;
}

export interface CapacityUnitsArgs extends core.SchemaArgs {
  queryCapacityUnits?: number | core.NumberOut;

  storageCapacityUnits?: number | core.NumberOut;
}

export class CapacityUnits extends core.Schema<CapacityUnitsArgs> {
  @core.attr(Number, { computed: true })
  public queryCapacityUnits?: number | core.NumberOut;

  @core.attr(Number, { computed: true })
  public storageCapacityUnits?: number | core.NumberOut;
}

export interface ServerSideEncryptionConfigurationArgs extends core.SchemaArgs {
  kmsKeyId?: string | core.StringOut;
}

export class ServerSideEncryptionConfiguration extends core.Schema<ServerSideEncryptionConfigurationArgs> {
  @core.attr(String)
  public kmsKeyId?: string | core.StringOut;
}

export interface IndexArgs extends core.ResourceArgs {
  capacityUnits?: CapacityUnits;

  description?: string | core.StringOut;

  documentMetadataConfigurationUpdates?:
    | core.Array<DocumentMetadataConfigurationUpdates>
    | core.ArrayOut<DocumentMetadataConfigurationUpdates>;

  edition?: string | core.StringOut;

  name: string | core.StringOut;

  roleArn: string | core.StringOut;

  serverSideEncryptionConfiguration?: ServerSideEncryptionConfiguration;

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

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

  userContextPolicy?: string | core.StringOut;

  userGroupResolutionConfiguration?: UserGroupResolutionConfiguration;

  userTokenConfigurations?: UserTokenConfigurations;
}

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

  @core.attr(CapacityUnits, { computed: true })
  public capacityUnits?: CapacityUnits;

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

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

  @core.attr(DocumentMetadataConfigurationUpdates, {
    computed: true,
    kind: "array",
  })
  public documentMetadataConfigurationUpdates?:
    | core.Array<DocumentMetadataConfigurationUpdates>
    | core.ArrayOut<DocumentMetadataConfigurationUpdates>;

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

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

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

  @core.attr(IndexStatistics, { computed: true, kind: "array" })
  public indexStatistics!:
    | core.Array<IndexStatistics>
    | core.ArrayOut<IndexStatistics>;

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

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

  @core.attr(ServerSideEncryptionConfiguration)
  public serverSideEncryptionConfiguration?: ServerSideEncryptionConfiguration;

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

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

  @core.attr(UserGroupResolutionConfiguration)
  public userGroupResolutionConfiguration?: UserGroupResolutionConfiguration;

  @core.attr(UserTokenConfigurations)
  public userTokenConfigurations?: UserTokenConfigurations;

  constructor(name: string, args?: IndexArgs) {
    super(name, "aws_kendra_index", args);
  }

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