
commonMain.aws.sdk.kotlin.services.kendra.model.S3DataSourceConfiguration.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.kendra.model
/**
* Provides the configuration information to connect to an Amazon S3 bucket.
*/
public class S3DataSourceConfiguration private constructor(builder: Builder) {
/**
* Provides the path to the S3 bucket that contains the user context filtering files for the data source. For the format of the file, see [Access control for S3 data sources](https://docs.aws.amazon.com/kendra/latest/dg/s3-acl.html).
*/
public val accessControlListConfiguration: aws.sdk.kotlin.services.kendra.model.AccessControlListConfiguration? = builder.accessControlListConfiguration
/**
* The name of the bucket that contains the documents.
*/
public val bucketName: kotlin.String = requireNotNull(builder.bucketName) { "A non-null value must be provided for bucketName" }
/**
* Document metadata files that contain information such as the document access control information, source URI, document author, and custom attributes. Each metadata file contains metadata about a single document.
*/
public val documentsMetadataConfiguration: aws.sdk.kotlin.services.kendra.model.DocumentsMetadataConfiguration? = builder.documentsMetadataConfiguration
/**
* A list of glob patterns for documents that should not be indexed. If a document that matches an inclusion prefix or inclusion pattern also matches an exclusion pattern, the document is not indexed.
*
* Some [examples](https://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters) are:
* + **.png , *.jpg* will exclude all PNG and JPEG image files in a directory (files with the extensions .png and .jpg).
* + **internal** will exclude all files in a directory that contain 'internal' in the file name, such as 'internal', 'internal_only', 'company_internal'.
* + ***/*internal** will exclude all internal-related files in a directory and its subdirectories.
*/
public val exclusionPatterns: List? = builder.exclusionPatterns
/**
* A list of glob patterns for documents that should be indexed. If a document that matches an inclusion pattern also matches an exclusion pattern, the document is not indexed.
*
* Some [examples](https://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters) are:
* + **.txt* will include all text files in a directory (files with the extension .txt).
* + ***/*.txt* will include all text files in a directory and its subdirectories.
* + **tax** will include all files in a directory that contain 'tax' in the file name, such as 'tax', 'taxes', 'income_tax'.
*/
public val inclusionPatterns: List? = builder.inclusionPatterns
/**
* A list of S3 prefixes for the documents that should be included in the index.
*/
public val inclusionPrefixes: List? = builder.inclusionPrefixes
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.kendra.model.S3DataSourceConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("S3DataSourceConfiguration(")
append("accessControlListConfiguration=$accessControlListConfiguration,")
append("bucketName=$bucketName,")
append("documentsMetadataConfiguration=$documentsMetadataConfiguration,")
append("exclusionPatterns=$exclusionPatterns,")
append("inclusionPatterns=$inclusionPatterns,")
append("inclusionPrefixes=$inclusionPrefixes")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = accessControlListConfiguration?.hashCode() ?: 0
result = 31 * result + (bucketName.hashCode())
result = 31 * result + (documentsMetadataConfiguration?.hashCode() ?: 0)
result = 31 * result + (exclusionPatterns?.hashCode() ?: 0)
result = 31 * result + (inclusionPatterns?.hashCode() ?: 0)
result = 31 * result + (inclusionPrefixes?.hashCode() ?: 0)
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as S3DataSourceConfiguration
if (accessControlListConfiguration != other.accessControlListConfiguration) return false
if (bucketName != other.bucketName) return false
if (documentsMetadataConfiguration != other.documentsMetadataConfiguration) return false
if (exclusionPatterns != other.exclusionPatterns) return false
if (inclusionPatterns != other.inclusionPatterns) return false
if (inclusionPrefixes != other.inclusionPrefixes) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.kendra.model.S3DataSourceConfiguration = Builder(this).apply(block).build()
public class Builder {
/**
* Provides the path to the S3 bucket that contains the user context filtering files for the data source. For the format of the file, see [Access control for S3 data sources](https://docs.aws.amazon.com/kendra/latest/dg/s3-acl.html).
*/
public var accessControlListConfiguration: aws.sdk.kotlin.services.kendra.model.AccessControlListConfiguration? = null
/**
* The name of the bucket that contains the documents.
*/
public var bucketName: kotlin.String? = null
/**
* Document metadata files that contain information such as the document access control information, source URI, document author, and custom attributes. Each metadata file contains metadata about a single document.
*/
public var documentsMetadataConfiguration: aws.sdk.kotlin.services.kendra.model.DocumentsMetadataConfiguration? = null
/**
* A list of glob patterns for documents that should not be indexed. If a document that matches an inclusion prefix or inclusion pattern also matches an exclusion pattern, the document is not indexed.
*
* Some [examples](https://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters) are:
* + **.png , *.jpg* will exclude all PNG and JPEG image files in a directory (files with the extensions .png and .jpg).
* + **internal** will exclude all files in a directory that contain 'internal' in the file name, such as 'internal', 'internal_only', 'company_internal'.
* + ***/*internal** will exclude all internal-related files in a directory and its subdirectories.
*/
public var exclusionPatterns: List? = null
/**
* A list of glob patterns for documents that should be indexed. If a document that matches an inclusion pattern also matches an exclusion pattern, the document is not indexed.
*
* Some [examples](https://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters) are:
* + **.txt* will include all text files in a directory (files with the extension .txt).
* + ***/*.txt* will include all text files in a directory and its subdirectories.
* + **tax** will include all files in a directory that contain 'tax' in the file name, such as 'tax', 'taxes', 'income_tax'.
*/
public var inclusionPatterns: List? = null
/**
* A list of S3 prefixes for the documents that should be included in the index.
*/
public var inclusionPrefixes: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.kendra.model.S3DataSourceConfiguration) : this() {
this.accessControlListConfiguration = x.accessControlListConfiguration
this.bucketName = x.bucketName
this.documentsMetadataConfiguration = x.documentsMetadataConfiguration
this.exclusionPatterns = x.exclusionPatterns
this.inclusionPatterns = x.inclusionPatterns
this.inclusionPrefixes = x.inclusionPrefixes
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.kendra.model.S3DataSourceConfiguration = S3DataSourceConfiguration(this)
/**
* construct an [aws.sdk.kotlin.services.kendra.model.AccessControlListConfiguration] inside the given [block]
*/
public fun accessControlListConfiguration(block: aws.sdk.kotlin.services.kendra.model.AccessControlListConfiguration.Builder.() -> kotlin.Unit) {
this.accessControlListConfiguration = aws.sdk.kotlin.services.kendra.model.AccessControlListConfiguration.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.kendra.model.DocumentsMetadataConfiguration] inside the given [block]
*/
public fun documentsMetadataConfiguration(block: aws.sdk.kotlin.services.kendra.model.DocumentsMetadataConfiguration.Builder.() -> kotlin.Unit) {
this.documentsMetadataConfiguration = aws.sdk.kotlin.services.kendra.model.DocumentsMetadataConfiguration.invoke(block)
}
internal fun correctErrors(): Builder {
if (bucketName == null) bucketName = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy