# Copyright (c) 2012-2025, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***


from . import AWSObject, AWSProperty, PropsDictType, Tags
from .validators import boolean, integer


class DocumentAttributeValue(AWSProperty):
    """
    `DocumentAttributeValue <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-documentattributevalue.html>`__
    """

    props: PropsDictType = {
        "DateValue": (str, False),
        "LongValue": (integer, False),
        "StringListValue": ([str], False),
        "StringValue": (str, False),
    }


class DocumentAttributeCondition(AWSProperty):
    """
    `DocumentAttributeCondition <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-documentattributecondition.html>`__
    """

    props: PropsDictType = {
        "ConditionDocumentAttributeKey": (str, True),
        "ConditionOnValue": (DocumentAttributeValue, False),
        "Operator": (str, True),
    }


class HookConfiguration(AWSProperty):
    """
    `HookConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-hookconfiguration.html>`__
    """

    props: PropsDictType = {
        "InvocationCondition": (DocumentAttributeCondition, False),
        "LambdaArn": (str, True),
        "S3Bucket": (str, True),
    }


class DocumentAttributeTarget(AWSProperty):
    """
    `DocumentAttributeTarget <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-documentattributetarget.html>`__
    """

    props: PropsDictType = {
        "TargetDocumentAttributeKey": (str, True),
        "TargetDocumentAttributeValue": (DocumentAttributeValue, False),
        "TargetDocumentAttributeValueDeletion": (boolean, False),
    }


class InlineCustomDocumentEnrichmentConfiguration(AWSProperty):
    """
    `InlineCustomDocumentEnrichmentConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-inlinecustomdocumentenrichmentconfiguration.html>`__
    """

    props: PropsDictType = {
        "Condition": (DocumentAttributeCondition, False),
        "DocumentContentDeletion": (boolean, False),
        "Target": (DocumentAttributeTarget, False),
    }


class CustomDocumentEnrichmentConfiguration(AWSProperty):
    """
    `CustomDocumentEnrichmentConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-customdocumentenrichmentconfiguration.html>`__
    """

    props: PropsDictType = {
        "InlineConfigurations": ([InlineCustomDocumentEnrichmentConfiguration], False),
        "PostExtractionHookConfiguration": (HookConfiguration, False),
        "PreExtractionHookConfiguration": (HookConfiguration, False),
        "RoleArn": (str, False),
    }


class TemplateConfiguration(AWSProperty):
    """
    `TemplateConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-templateconfiguration.html>`__
    """

    props: PropsDictType = {
        "Template": (dict, True),
    }


class DataSourceConfiguration(AWSProperty):
    """
    `DataSourceConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-datasource-datasourceconfiguration.html>`__
    """

    props: PropsDictType = {
        "TemplateConfiguration": (TemplateConfiguration, False),
    }


class DataSource(AWSObject):
    """
    `DataSource <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kendra-datasource.html>`__
    """

    resource_type = "AWS::Kendra::DataSource"

    props: PropsDictType = {
        "CustomDocumentEnrichmentConfiguration": (
            CustomDocumentEnrichmentConfiguration,
            False,
        ),
        "DataSourceConfiguration": (DataSourceConfiguration, False),
        "Description": (str, False),
        "IndexId": (str, True),
        "LanguageCode": (str, False),
        "Name": (str, True),
        "RoleArn": (str, False),
        "Schedule": (str, False),
        "Tags": (Tags, False),
        "Type": (str, True),
    }


class S3Path(AWSProperty):
    """
    `S3Path <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-faq-s3path.html>`__
    """

    props: PropsDictType = {
        "Bucket": (str, True),
        "Key": (str, True),
    }


class Faq(AWSObject):
    """
    `Faq <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kendra-faq.html>`__
    """

    resource_type = "AWS::Kendra::Faq"

    props: PropsDictType = {
        "Description": (str, False),
        "FileFormat": (str, False),
        "IndexId": (str, True),
        "LanguageCode": (str, False),
        "Name": (str, True),
        "RoleArn": (str, True),
        "S3Path": (S3Path, True),
        "Tags": (Tags, False),
    }


class CapacityUnitsConfiguration(AWSProperty):
    """
    `CapacityUnitsConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-index-capacityunitsconfiguration.html>`__
    """

    props: PropsDictType = {
        "QueryCapacityUnits": (integer, True),
        "StorageCapacityUnits": (integer, True),
    }


class ValueImportanceItem(AWSProperty):
    """
    `ValueImportanceItem <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-index-valueimportanceitem.html>`__
    """

    props: PropsDictType = {
        "Key": (str, False),
        "Value": (integer, False),
    }


class Relevance(AWSProperty):
    """
    `Relevance <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-index-relevance.html>`__
    """

    props: PropsDictType = {
        "Duration": (str, False),
        "Freshness": (boolean, False),
        "Importance": (integer, False),
        "RankOrder": (str, False),
        "ValueImportanceItems": ([ValueImportanceItem], False),
    }


class Search(AWSProperty):
    """
    `Search <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-index-search.html>`__
    """

    props: PropsDictType = {
        "Displayable": (boolean, False),
        "Facetable": (boolean, False),
        "Searchable": (boolean, False),
        "Sortable": (boolean, False),
    }


class DocumentMetadataConfiguration(AWSProperty):
    """
    `DocumentMetadataConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-index-documentmetadataconfiguration.html>`__
    """

    props: PropsDictType = {
        "Name": (str, True),
        "Relevance": (Relevance, False),
        "Search": (Search, False),
        "Type": (str, True),
    }


class ServerSideEncryptionConfiguration(AWSProperty):
    """
    `ServerSideEncryptionConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-index-serversideencryptionconfiguration.html>`__
    """

    props: PropsDictType = {
        "KmsKeyId": (str, False),
    }


class JsonTokenTypeConfiguration(AWSProperty):
    """
    `JsonTokenTypeConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-index-jsontokentypeconfiguration.html>`__
    """

    props: PropsDictType = {
        "GroupAttributeField": (str, True),
        "UserNameAttributeField": (str, True),
    }


class JwtTokenTypeConfiguration(AWSProperty):
    """
    `JwtTokenTypeConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-index-jwttokentypeconfiguration.html>`__
    """

    props: PropsDictType = {
        "ClaimRegex": (str, False),
        "GroupAttributeField": (str, False),
        "Issuer": (str, False),
        "KeyLocation": (str, True),
        "SecretManagerArn": (str, False),
        "URL": (str, False),
        "UserNameAttributeField": (str, False),
    }


class UserTokenConfiguration(AWSProperty):
    """
    `UserTokenConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kendra-index-usertokenconfiguration.html>`__
    """

    props: PropsDictType = {
        "JsonTokenTypeConfiguration": (JsonTokenTypeConfiguration, False),
        "JwtTokenTypeConfiguration": (JwtTokenTypeConfiguration, False),
    }


class Index(AWSObject):
    """
    `Index <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kendra-index.html>`__
    """

    resource_type = "AWS::Kendra::Index"

    props: PropsDictType = {
        "CapacityUnits": (CapacityUnitsConfiguration, False),
        "Description": (str, False),
        "DocumentMetadataConfigurations": ([DocumentMetadataConfiguration], False),
        "Edition": (str, True),
        "Name": (str, True),
        "RoleArn": (str, True),
        "ServerSideEncryptionConfiguration": (ServerSideEncryptionConfiguration, False),
        "Tags": (Tags, False),
        "UserContextPolicy": (str, False),
        "UserTokenConfigurations": ([UserTokenConfiguration], False),
    }
