
commonMain.aws.sdk.kotlin.services.kendra.model.ServiceNowKnowledgeArticleConfiguration.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.kendra.model
/**
* Provides the configuration information for crawling knowledge articles in the ServiceNow site.
*/
public class ServiceNowKnowledgeArticleConfiguration private constructor(builder: Builder) {
/**
* `TRUE` to index attachments to knowledge articles.
*/
public val crawlAttachments: kotlin.Boolean = builder.crawlAttachments
/**
* The name of the ServiceNow field that is mapped to the index document contents field in the Amazon Kendra index.
*/
public val documentDataFieldName: kotlin.String = requireNotNull(builder.documentDataFieldName) { "A non-null value must be provided for documentDataFieldName" }
/**
* The name of the ServiceNow field that is mapped to the index document title field.
*/
public val documentTitleFieldName: kotlin.String? = builder.documentTitleFieldName
/**
* A list of regular expression patterns applied to exclude certain knowledge article attachments. Attachments that match the patterns are excluded from the index. Items that don't match the patterns are included in the index. If an item matches both an inclusion and exclusion pattern, the exclusion pattern takes precedence and the item isn't included in the index.
*/
public val excludeAttachmentFilePatterns: List? = builder.excludeAttachmentFilePatterns
/**
* Maps attributes or field names of knoweldge articles to Amazon Kendra index field names. To create custom fields, use the `UpdateIndex` API before you map to ServiceNow fields. For more information, see [Mapping data source fields](https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html). The ServiceNow data source field names must exist in your ServiceNow custom metadata.
*/
public val fieldMappings: List? = builder.fieldMappings
/**
* A query that selects the knowledge articles to index. The query can return articles from multiple knowledge bases, and the knowledge bases can be public or private.
*
* The query string must be one generated by the ServiceNow console. For more information, see [Specifying documents to index with a query](https://docs.aws.amazon.com/kendra/latest/dg/servicenow-query.html).
*/
public val filterQuery: kotlin.String? = builder.filterQuery
/**
* A list of regular expression patterns applied to include knowledge article attachments. Attachments that match the patterns are included in the index. Items that don't match the patterns are excluded from the index. If an item matches both an inclusion and exclusion pattern, the exclusion pattern takes precedence and the item isn't included in the index.
*/
public val includeAttachmentFilePatterns: List? = builder.includeAttachmentFilePatterns
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.kendra.model.ServiceNowKnowledgeArticleConfiguration = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ServiceNowKnowledgeArticleConfiguration(")
append("crawlAttachments=$crawlAttachments,")
append("documentDataFieldName=$documentDataFieldName,")
append("documentTitleFieldName=$documentTitleFieldName,")
append("excludeAttachmentFilePatterns=$excludeAttachmentFilePatterns,")
append("fieldMappings=$fieldMappings,")
append("filterQuery=$filterQuery,")
append("includeAttachmentFilePatterns=$includeAttachmentFilePatterns")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = crawlAttachments.hashCode()
result = 31 * result + (documentDataFieldName.hashCode())
result = 31 * result + (documentTitleFieldName?.hashCode() ?: 0)
result = 31 * result + (excludeAttachmentFilePatterns?.hashCode() ?: 0)
result = 31 * result + (fieldMappings?.hashCode() ?: 0)
result = 31 * result + (filterQuery?.hashCode() ?: 0)
result = 31 * result + (includeAttachmentFilePatterns?.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 ServiceNowKnowledgeArticleConfiguration
if (crawlAttachments != other.crawlAttachments) return false
if (documentDataFieldName != other.documentDataFieldName) return false
if (documentTitleFieldName != other.documentTitleFieldName) return false
if (excludeAttachmentFilePatterns != other.excludeAttachmentFilePatterns) return false
if (fieldMappings != other.fieldMappings) return false
if (filterQuery != other.filterQuery) return false
if (includeAttachmentFilePatterns != other.includeAttachmentFilePatterns) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.kendra.model.ServiceNowKnowledgeArticleConfiguration = Builder(this).apply(block).build()
public class Builder {
/**
* `TRUE` to index attachments to knowledge articles.
*/
public var crawlAttachments: kotlin.Boolean = false
/**
* The name of the ServiceNow field that is mapped to the index document contents field in the Amazon Kendra index.
*/
public var documentDataFieldName: kotlin.String? = null
/**
* The name of the ServiceNow field that is mapped to the index document title field.
*/
public var documentTitleFieldName: kotlin.String? = null
/**
* A list of regular expression patterns applied to exclude certain knowledge article attachments. Attachments that match the patterns are excluded from the index. Items that don't match the patterns are included in the index. If an item matches both an inclusion and exclusion pattern, the exclusion pattern takes precedence and the item isn't included in the index.
*/
public var excludeAttachmentFilePatterns: List? = null
/**
* Maps attributes or field names of knoweldge articles to Amazon Kendra index field names. To create custom fields, use the `UpdateIndex` API before you map to ServiceNow fields. For more information, see [Mapping data source fields](https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html). The ServiceNow data source field names must exist in your ServiceNow custom metadata.
*/
public var fieldMappings: List? = null
/**
* A query that selects the knowledge articles to index. The query can return articles from multiple knowledge bases, and the knowledge bases can be public or private.
*
* The query string must be one generated by the ServiceNow console. For more information, see [Specifying documents to index with a query](https://docs.aws.amazon.com/kendra/latest/dg/servicenow-query.html).
*/
public var filterQuery: kotlin.String? = null
/**
* A list of regular expression patterns applied to include knowledge article attachments. Attachments that match the patterns are included in the index. Items that don't match the patterns are excluded from the index. If an item matches both an inclusion and exclusion pattern, the exclusion pattern takes precedence and the item isn't included in the index.
*/
public var includeAttachmentFilePatterns: List? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.kendra.model.ServiceNowKnowledgeArticleConfiguration) : this() {
this.crawlAttachments = x.crawlAttachments
this.documentDataFieldName = x.documentDataFieldName
this.documentTitleFieldName = x.documentTitleFieldName
this.excludeAttachmentFilePatterns = x.excludeAttachmentFilePatterns
this.fieldMappings = x.fieldMappings
this.filterQuery = x.filterQuery
this.includeAttachmentFilePatterns = x.includeAttachmentFilePatterns
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.kendra.model.ServiceNowKnowledgeArticleConfiguration = ServiceNowKnowledgeArticleConfiguration(this)
internal fun correctErrors(): Builder {
if (documentDataFieldName == null) documentDataFieldName = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy