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

export interface ConditionOnValueArgs extends core.SchemaArgs {
  dateValue?: string | core.StringOut;

  longValue?: number | core.NumberOut;

  stringListValue?: core.Array<string> | core.ArrayOut<core.StringOut>;

  stringValue?: string | core.StringOut;
}

export class ConditionOnValue extends core.Schema<ConditionOnValueArgs> {
  @core.attr(String)
  public dateValue?: string | core.StringOut;

  @core.attr(Number)
  public longValue?: number | core.NumberOut;

  @core.attr(String, { kind: "array" })
  public stringListValue?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

export interface InvocationConditionArgs extends core.SchemaArgs {
  conditionDocumentAttributeKey: string | core.StringOut;

  conditionOnValue?: ConditionOnValue;

  operator: string | core.StringOut;
}

export class InvocationCondition extends core.Schema<InvocationConditionArgs> {
  @core.attr(String)
  public conditionDocumentAttributeKey!: string | core.StringOut;

  @core.attr(ConditionOnValue)
  public conditionOnValue?: ConditionOnValue;

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

export interface PostExtractionHookConfigurationArgs extends core.SchemaArgs {
  invocationCondition?: InvocationCondition;

  lambdaArn: string | core.StringOut;

  s3Bucket: string | core.StringOut;
}

export class PostExtractionHookConfiguration extends core.Schema<PostExtractionHookConfigurationArgs> {
  @core.attr(InvocationCondition)
  public invocationCondition?: InvocationCondition;

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

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

export interface PreExtractionHookConfigurationArgs extends core.SchemaArgs {
  invocationCondition?: InvocationCondition;

  lambdaArn: string | core.StringOut;

  s3Bucket: string | core.StringOut;
}

export class PreExtractionHookConfiguration extends core.Schema<PreExtractionHookConfigurationArgs> {
  @core.attr(InvocationCondition)
  public invocationCondition?: InvocationCondition;

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

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

export interface TargetDocumentAttributeValueArgs extends core.SchemaArgs {
  dateValue?: string | core.StringOut;

  longValue?: number | core.NumberOut;

  stringListValue?: core.Array<string> | core.ArrayOut<core.StringOut>;

  stringValue?: string | core.StringOut;
}

export class TargetDocumentAttributeValue extends core.Schema<TargetDocumentAttributeValueArgs> {
  @core.attr(String)
  public dateValue?: string | core.StringOut;

  @core.attr(Number)
  public longValue?: number | core.NumberOut;

  @core.attr(String, { kind: "array" })
  public stringListValue?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

export interface TargetArgs extends core.SchemaArgs {
  targetDocumentAttributeKey?: string | core.StringOut;

  targetDocumentAttributeValue?: TargetDocumentAttributeValue;

  targetDocumentAttributeValueDeletion?: boolean | core.BooleanOut;
}

export class Target extends core.Schema<TargetArgs> {
  @core.attr(String)
  public targetDocumentAttributeKey?: string | core.StringOut;

  @core.attr(TargetDocumentAttributeValue)
  public targetDocumentAttributeValue?: TargetDocumentAttributeValue;

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

export interface ConditionArgs extends core.SchemaArgs {
  conditionDocumentAttributeKey: string | core.StringOut;

  conditionOnValue?: ConditionOnValue;

  operator: string | core.StringOut;
}

export class Condition extends core.Schema<ConditionArgs> {
  @core.attr(String)
  public conditionDocumentAttributeKey!: string | core.StringOut;

  @core.attr(ConditionOnValue)
  public conditionOnValue?: ConditionOnValue;

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

export interface InlineConfigurationsArgs extends core.SchemaArgs {
  condition?: Condition;

  documentContentDeletion?: boolean | core.BooleanOut;

  target?: Target;
}

export class InlineConfigurations extends core.Schema<InlineConfigurationsArgs> {
  @core.attr(Condition)
  public condition?: Condition;

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

  @core.attr(Target)
  public target?: Target;
}

export interface CustomDocumentEnrichmentConfigurationArgs
  extends core.SchemaArgs {
  inlineConfigurations?:
    | core.Array<InlineConfigurations>
    | core.ArrayOut<InlineConfigurations>;

  postExtractionHookConfiguration?: PostExtractionHookConfiguration;

  preExtractionHookConfiguration?: PreExtractionHookConfiguration;

  roleArn?: string | core.StringOut;
}

export class CustomDocumentEnrichmentConfiguration extends core.Schema<CustomDocumentEnrichmentConfigurationArgs> {
  @core.attr(InlineConfigurations, { kind: "array" })
  public inlineConfigurations?:
    | core.Array<InlineConfigurations>
    | core.ArrayOut<InlineConfigurations>;

  @core.attr(PostExtractionHookConfiguration)
  public postExtractionHookConfiguration?: PostExtractionHookConfiguration;

  @core.attr(PreExtractionHookConfiguration)
  public preExtractionHookConfiguration?: PreExtractionHookConfiguration;

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

export interface AccessControlListConfigurationArgs extends core.SchemaArgs {
  keyPath?: string | core.StringOut;
}

export class AccessControlListConfiguration extends core.Schema<AccessControlListConfigurationArgs> {
  @core.attr(String)
  public keyPath?: string | core.StringOut;
}

export interface DocumentsMetadataConfigurationArgs extends core.SchemaArgs {
  s3Prefix?: string | core.StringOut;
}

export class DocumentsMetadataConfiguration extends core.Schema<DocumentsMetadataConfigurationArgs> {
  @core.attr(String)
  public s3Prefix?: string | core.StringOut;
}

export interface S3ConfigurationArgs extends core.SchemaArgs {
  accessControlListConfiguration?: AccessControlListConfiguration;

  bucketName: string | core.StringOut;

  documentsMetadataConfiguration?: DocumentsMetadataConfiguration;

  exclusionPatterns?: core.Array<string> | core.ArrayOut<core.StringOut>;

  inclusionPatterns?: core.Array<string> | core.ArrayOut<core.StringOut>;

  inclusionPrefixes?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class S3Configuration extends core.Schema<S3ConfigurationArgs> {
  @core.attr(AccessControlListConfiguration)
  public accessControlListConfiguration?: AccessControlListConfiguration;

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

  @core.attr(DocumentsMetadataConfiguration)
  public documentsMetadataConfiguration?: DocumentsMetadataConfiguration;

  @core.attr(String, { kind: "array" })
  public exclusionPatterns?: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { kind: "array" })
  public inclusionPatterns?: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { kind: "array" })
  public inclusionPrefixes?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface SeedUrlConfigurationArgs extends core.SchemaArgs {
  seedUrls: core.Array<string> | core.ArrayOut<core.StringOut>;

  webCrawlerMode?: string | core.StringOut;
}

export class SeedUrlConfiguration extends core.Schema<SeedUrlConfigurationArgs> {
  @core.attr(String, { kind: "array" })
  public seedUrls!: core.Array<string> | core.ArrayOut<core.StringOut>;

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

export interface SiteMapsConfigurationArgs extends core.SchemaArgs {
  siteMaps: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class SiteMapsConfiguration extends core.Schema<SiteMapsConfigurationArgs> {
  @core.attr(String, { kind: "array" })
  public siteMaps!: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface UrlsArgs extends core.SchemaArgs {
  seedUrlConfiguration?: SeedUrlConfiguration;

  siteMapsConfiguration?: SiteMapsConfiguration;
}

export class Urls extends core.Schema<UrlsArgs> {
  @core.attr(SeedUrlConfiguration)
  public seedUrlConfiguration?: SeedUrlConfiguration;

  @core.attr(SiteMapsConfiguration)
  public siteMapsConfiguration?: SiteMapsConfiguration;
}

export interface BasicAuthenticationArgs extends core.SchemaArgs {
  credentials: string | core.StringOut;

  host: string | core.StringOut;

  port: number | core.NumberOut;
}

export class BasicAuthentication extends core.Schema<BasicAuthenticationArgs> {
  @core.attr(String)
  public credentials!: string | core.StringOut;

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

  @core.attr(Number)
  public port!: number | core.NumberOut;
}

export interface AuthenticationConfigurationArgs extends core.SchemaArgs {
  basicAuthentication?:
    | core.Array<BasicAuthentication>
    | core.ArrayOut<BasicAuthentication>;
}

export class AuthenticationConfiguration extends core.Schema<AuthenticationConfigurationArgs> {
  @core.attr(BasicAuthentication, { kind: "array" })
  public basicAuthentication?:
    | core.Array<BasicAuthentication>
    | core.ArrayOut<BasicAuthentication>;
}

export interface ProxyConfigurationArgs extends core.SchemaArgs {
  credentials?: string | core.StringOut;

  host: string | core.StringOut;

  port: number | core.NumberOut;
}

export class ProxyConfiguration extends core.Schema<ProxyConfigurationArgs> {
  @core.attr(String)
  public credentials?: string | core.StringOut;

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

  @core.attr(Number)
  public port!: number | core.NumberOut;
}

export interface WebCrawlerConfigurationArgs extends core.SchemaArgs {
  authenticationConfiguration?: AuthenticationConfiguration;

  crawlDepth?: number | core.NumberOut;

  maxContentSizePerPageInMegaBytes?: number | core.NumberOut;

  maxLinksPerPage?: number | core.NumberOut;

  maxUrlsPerMinuteCrawlRate?: number | core.NumberOut;

  proxyConfiguration?: ProxyConfiguration;

  urlExclusionPatterns?: core.Array<string> | core.ArrayOut<core.StringOut>;

  urlInclusionPatterns?: core.Array<string> | core.ArrayOut<core.StringOut>;

  urls: Urls;
}

export class WebCrawlerConfiguration extends core.Schema<WebCrawlerConfigurationArgs> {
  @core.attr(AuthenticationConfiguration)
  public authenticationConfiguration?: AuthenticationConfiguration;

  @core.attr(Number)
  public crawlDepth?: number | core.NumberOut;

  @core.attr(Number)
  public maxContentSizePerPageInMegaBytes?: number | core.NumberOut;

  @core.attr(Number)
  public maxLinksPerPage?: number | core.NumberOut;

  @core.attr(Number)
  public maxUrlsPerMinuteCrawlRate?: number | core.NumberOut;

  @core.attr(ProxyConfiguration)
  public proxyConfiguration?: ProxyConfiguration;

  @core.attr(String, { kind: "array" })
  public urlExclusionPatterns?:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;

  @core.attr(String, { kind: "array" })
  public urlInclusionPatterns?:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;

  @core.attr(Urls)
  public urls!: Urls;
}

export interface ConfigurationArgs extends core.SchemaArgs {
  s3Configuration?: S3Configuration;

  webCrawlerConfiguration?: WebCrawlerConfiguration;
}

export class Configuration extends core.Schema<ConfigurationArgs> {
  @core.attr(S3Configuration)
  public s3Configuration?: S3Configuration;

  @core.attr(WebCrawlerConfiguration)
  public webCrawlerConfiguration?: WebCrawlerConfiguration;
}

export interface DataSourceArgs extends core.ResourceArgs {
  configuration?: Configuration;

  customDocumentEnrichmentConfiguration?: CustomDocumentEnrichmentConfiguration;

  description?: string | core.StringOut;

  indexId: string | core.StringOut;

  languageCode?: string | core.StringOut;

  name: string | core.StringOut;

  roleArn?: string | core.StringOut;

  schedule?: string | core.StringOut;

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

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

  type: string | core.StringOut;
}

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

  @core.attr(Configuration)
  public configuration?: Configuration;

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

  @core.attr(CustomDocumentEnrichmentConfiguration)
  public customDocumentEnrichmentConfiguration?: CustomDocumentEnrichmentConfiguration;

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

  @core.attr(String)
  public description?: 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(String)
  public indexId!: string | core.StringOut;

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

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

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

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

  @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)
  public type!: string | core.StringOut;

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

  constructor(name: string, args?: DataSourceArgs) {
    super(name, "aws_kendra_data_source", args);
  }

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