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


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


class AclConfiguration(AWSProperty):
    props = {
        'AllowedGroupsColumnName': (basestring, True),
    }


class ChangeDetectingColumns(AWSProperty):
    props = {
        'ChangeDetectingColumns': ([basestring], False),
    }


class DataSourceToIndexFieldMapping(AWSProperty):
    props = {
        'DataSourceFieldName': (basestring, True),
        'DateFieldFormat': (basestring, False),
        'IndexFieldName': (basestring, True),
    }


class DataSourceToIndexFieldMappingList(AWSProperty):
    props = {
        'DataSourceToIndexFieldMappingList':
            ([DataSourceToIndexFieldMapping], False),
    }


class ColumnConfiguration(AWSProperty):
    props = {
        'ChangeDetectingColumns': (ChangeDetectingColumns, True),
        'DocumentDataColumnName': (basestring, True),
        'DocumentIdColumnName': (basestring, True),
        'DocumentTitleColumnName': (basestring, False),
        'FieldMappings': (DataSourceToIndexFieldMappingList, False),
    }


class ConnectionConfiguration(AWSProperty):
    props = {
        'DatabaseHost': (basestring, True),
        'DatabaseName': (basestring, True),
        'DatabasePort': (integer, True),
        'SecretArn': (basestring, True),
        'TableName': (basestring, True),
    }


class DataSourceVpcConfiguration(AWSProperty):
    props = {
        'SecurityGroupIds': ([basestring], True),
        'SubnetIds': ([basestring], True),
    }


class SqlConfiguration(AWSProperty):
    props = {
        'QueryIdentifiersEnclosingOption': (basestring, False),
    }


class DatabaseConfiguration(AWSProperty):
    props = {
        'AclConfiguration': (AclConfiguration, False),
        'ColumnConfiguration': (ColumnConfiguration, True),
        'ConnectionConfiguration': (ConnectionConfiguration, True),
        'DatabaseEngineType': (basestring, True),
        'SqlConfiguration': (SqlConfiguration, False),
        'VpcConfiguration': (DataSourceVpcConfiguration, False),
    }


class DataSourceInclusionsExclusionsStrings(AWSProperty):
    props = {
        'DataSourceInclusionsExclusionsStrings': ([basestring], False),
    }


class OneDriveUserList(AWSProperty):
    props = {
        'OneDriveUserList': ([basestring], False),
    }


class S3Path(AWSProperty):
    props = {
        'Bucket': (basestring, True),
        'Key': (basestring, True),
    }


class OneDriveUsers(AWSProperty):
    props = {
        'OneDriveUserList': (OneDriveUserList, False),
        'OneDriveUserS3Path': (S3Path, False),
    }


class OneDriveConfiguration(AWSProperty):
    props = {
        'ExclusionPatterns': (DataSourceInclusionsExclusionsStrings, False),
        'FieldMappings': (DataSourceToIndexFieldMappingList, False),
        'InclusionPatterns': (DataSourceInclusionsExclusionsStrings, False),
        'OneDriveUsers': (OneDriveUsers, True),
        'SecretArn': (basestring, True),
        'TenantDomain': (basestring, True),
    }


class AccessControlListConfiguration(AWSProperty):
    props = {
        'KeyPath': (basestring, False),
    }


class DocumentsMetadataConfiguration(AWSProperty):
    props = {
        'S3Prefix': (basestring, False),
    }


class S3DataSourceConfiguration(AWSProperty):
    props = {
        'AccessControlListConfiguration':
            (AccessControlListConfiguration, False),
        'BucketName': (basestring, True),
        'DocumentsMetadataConfiguration':
            (DocumentsMetadataConfiguration, False),
        'ExclusionPatterns': (DataSourceInclusionsExclusionsStrings, False),
        'InclusionPrefixes': (DataSourceInclusionsExclusionsStrings, False),
    }


class SalesforceChatterFeedIncludeFilterTypes(AWSProperty):
    props = {
        'SalesforceChatterFeedIncludeFilterTypes': ([basestring], False),
    }


class SalesforceChatterFeedConfiguration(AWSProperty):
    props = {
        'DocumentDataFieldName': (basestring, True),
        'DocumentTitleFieldName': (basestring, False),
        'FieldMappings': (DataSourceToIndexFieldMappingList, False),
        'IncludeFilterTypes':
            (SalesforceChatterFeedIncludeFilterTypes, False),
    }


class SalesforceCustomKnowledgeArticleTypeConfiguration(AWSProperty):
    props = {
        'DocumentDataFieldName': (basestring, True),
        'DocumentTitleFieldName': (basestring, False),
        'FieldMappings': (DataSourceToIndexFieldMappingList, False),
        'Name': (basestring, True),
    }


class SalesforceCustomKnowledgeArticleTypeConfigurationList(AWSProperty):
    props = {
        'SalesforceCustomKnowledgeArticleTypeConfigurationList':
            ([SalesforceCustomKnowledgeArticleTypeConfiguration], False),
    }


class SalesforceKnowledgeArticleStateList(AWSProperty):
    props = {
        'SalesforceKnowledgeArticleStateList': ([basestring], False),
    }


class SalesforceStandardKnowledgeArticleTypeConfiguration(AWSProperty):
    props = {
        'DocumentDataFieldName': (basestring, True),
        'DocumentTitleFieldName': (basestring, False),
        'FieldMappings': (DataSourceToIndexFieldMappingList, False),
    }


class SalesforceKnowledgeArticleConfiguration(AWSProperty):
    props = {
        'CustomKnowledgeArticleTypeConfigurations':
            (SalesforceCustomKnowledgeArticleTypeConfigurationList, False),
        'IncludedStates': (SalesforceKnowledgeArticleStateList, True),
        'StandardKnowledgeArticleTypeConfiguration':
            (SalesforceStandardKnowledgeArticleTypeConfiguration, False),
    }


class SalesforceStandardObjectAttachmentConfiguration(AWSProperty):
    props = {
        'DocumentTitleFieldName': (basestring, False),
        'FieldMappings': (DataSourceToIndexFieldMappingList, False),
    }


class SalesforceStandardObjectConfiguration(AWSProperty):
    props = {
        'DocumentDataFieldName': (basestring, True),
        'DocumentTitleFieldName': (basestring, False),
        'FieldMappings': (DataSourceToIndexFieldMappingList, False),
        'Name': (basestring, True),
    }


class SalesforceStandardObjectConfigurationList(AWSProperty):
    props = {
        'SalesforceStandardObjectConfigurationList':
            ([SalesforceStandardObjectConfiguration], False),
    }


class SalesforceConfiguration(AWSProperty):
    props = {
        'ChatterFeedConfiguration':
            (SalesforceChatterFeedConfiguration, False),
        'CrawlAttachments': (boolean, False),
        'ExcludeAttachmentFilePatterns':
            (DataSourceInclusionsExclusionsStrings, False),
        'IncludeAttachmentFilePatterns':
            (DataSourceInclusionsExclusionsStrings, False),
        'KnowledgeArticleConfiguration':
            (SalesforceKnowledgeArticleConfiguration, False),
        'SecretArn': (basestring, True),
        'ServerUrl': (basestring, True),
        'StandardObjectAttachmentConfiguration':
            (SalesforceStandardObjectAttachmentConfiguration, False),
        'StandardObjectConfigurations':
            (SalesforceStandardObjectConfigurationList, False),
    }


class ServiceNowKnowledgeArticleConfiguration(AWSProperty):
    props = {
        'CrawlAttachments': (boolean, False),
        'DocumentDataFieldName': (basestring, True),
        'DocumentTitleFieldName': (basestring, False),
        'ExcludeAttachmentFilePatterns':
            (DataSourceInclusionsExclusionsStrings, False),
        'FieldMappings': (DataSourceToIndexFieldMappingList, False),
        'IncludeAttachmentFilePatterns':
            (DataSourceInclusionsExclusionsStrings, False),
    }


class ServiceNowServiceCatalogConfiguration(AWSProperty):
    props = {
        'CrawlAttachments': (boolean, False),
        'DocumentDataFieldName': (basestring, True),
        'DocumentTitleFieldName': (basestring, False),
        'ExcludeAttachmentFilePatterns':
            (DataSourceInclusionsExclusionsStrings, False),
        'FieldMappings': (DataSourceToIndexFieldMappingList, False),
        'IncludeAttachmentFilePatterns':
            (DataSourceInclusionsExclusionsStrings, False),
    }


class ServiceNowConfiguration(AWSProperty):
    props = {
        'HostUrl': (basestring, True),
        'KnowledgeArticleConfiguration':
            (ServiceNowKnowledgeArticleConfiguration, False),
        'SecretArn': (basestring, True),
        'ServiceCatalogConfiguration':
            (ServiceNowServiceCatalogConfiguration, False),
        'ServiceNowBuildVersion': (basestring, True),
    }


class SharePointConfiguration(AWSProperty):
    props = {
        'CrawlAttachments': (boolean, False),
        'DocumentTitleFieldName': (basestring, False),
        'ExclusionPatterns': (DataSourceInclusionsExclusionsStrings, False),
        'FieldMappings': (DataSourceToIndexFieldMappingList, False),
        'InclusionPatterns': (DataSourceInclusionsExclusionsStrings, False),
        'SecretArn': (basestring, True),
        'SharePointVersion': (basestring, True),
        'Urls': ([basestring], True),
        'UseChangeLog': (boolean, False),
        'VpcConfiguration': (DataSourceVpcConfiguration, False),
    }


class DataSourceConfiguration(AWSProperty):
    props = {
        'DatabaseConfiguration': (DatabaseConfiguration, False),
        'OneDriveConfiguration': (OneDriveConfiguration, False),
        'S3Configuration': (S3DataSourceConfiguration, False),
        'SalesforceConfiguration': (SalesforceConfiguration, False),
        'ServiceNowConfiguration': (ServiceNowConfiguration, False),
        'SharePointConfiguration': (SharePointConfiguration, False),
    }


class DataSource(AWSObject):
    resource_type = "AWS::Kendra::DataSource"

    props = {
        'DataSourceConfiguration': (DataSourceConfiguration, True),
        'Description': (basestring, False),
        'IndexId': (basestring, True),
        'Name': (basestring, True),
        'RoleArn': (basestring, True),
        'Schedule': (basestring, False),
        'Tags': (Tags, False),
        'Type': (basestring, True),
    }


class Faq(AWSObject):
    resource_type = "AWS::Kendra::Faq"

    props = {
        'Description': (basestring, False),
        'FileFormat': (basestring, False),
        'IndexId': (basestring, True),
        'Name': (basestring, True),
        'RoleArn': (basestring, True),
        'S3Path': (S3Path, True),
        'Tags': (Tags, False),
    }


class CapacityUnitsConfiguration(AWSProperty):
    props = {
        'QueryCapacityUnits': (integer, True),
        'StorageCapacityUnits': (integer, True),
    }


class ValueImportanceItem(AWSProperty):
    props = {
        'Key': (basestring, False),
        'Value': (integer, False),
    }


class ValueImportanceItems(AWSProperty):
    props = {
        'ValueImportanceItems': ([ValueImportanceItem], False),
    }


class Relevance(AWSProperty):
    props = {
        'Duration': (basestring, False),
        'Freshness': (boolean, False),
        'Importance': (integer, False),
        'RankOrder': (basestring, False),
        'ValueImportanceItems': (ValueImportanceItems, False),
    }


class Search(AWSProperty):
    props = {
        'Displayable': (boolean, False),
        'Facetable': (boolean, False),
        'Searchable': (boolean, False),
        'Sortable': (boolean, False),
    }


class DocumentMetadataConfiguration(AWSProperty):
    props = {
        'Name': (basestring, True),
        'Relevance': (Relevance, False),
        'Search': (Search, False),
        'Type': (basestring, True),
    }


class DocumentMetadataConfigurationList(AWSProperty):
    props = {
        'DocumentMetadataConfigurationList':
            ([DocumentMetadataConfiguration], False),
    }


class ServerSideEncryptionConfiguration(AWSProperty):
    props = {
        'KmsKeyId': (basestring, False),
    }


class Index(AWSObject):
    resource_type = "AWS::Kendra::Index"

    props = {
        'CapacityUnits': (CapacityUnitsConfiguration, False),
        'Description': (basestring, False),
        'DocumentMetadataConfigurations':
            (DocumentMetadataConfigurationList, False),
        'Edition': (basestring, True),
        'Name': (basestring, True),
        'RoleArn': (basestring, True),
        'ServerSideEncryptionConfiguration':
            (ServerSideEncryptionConfiguration, False),
        'Tags': (Tags, False),
    }
