commonMain.aws.sdk.kotlin.services.wisdom.model.CreateKnowledgeBaseRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wisdom-jvm Show documentation
Show all versions of wisdom-jvm Show documentation
The AWS SDK for Kotlin client for Wisdom
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.wisdom.model
import aws.smithy.kotlin.runtime.SdkDsl
public class CreateKnowledgeBaseRequest private constructor(builder: Builder) {
/**
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see [Making retries safe with idempotent APIs](https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/).
*/
public val clientToken: kotlin.String? = builder.clientToken
/**
* The description.
*/
public val description: kotlin.String? = builder.description
/**
* The type of knowledge base. Only CUSTOM knowledge bases allow you to upload your own content. EXTERNAL knowledge bases support integrations with third-party systems whose content is synchronized automatically.
*/
public val knowledgeBaseType: aws.sdk.kotlin.services.wisdom.model.KnowledgeBaseType = requireNotNull(builder.knowledgeBaseType) { "A non-null value must be provided for knowledgeBaseType" }
/**
* The name of the knowledge base.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* Information about how to render the content.
*/
public val renderingConfiguration: aws.sdk.kotlin.services.wisdom.model.RenderingConfiguration? = builder.renderingConfiguration
/**
* The configuration information for the customer managed key used for encryption.
*
* This KMS key must have a policy that allows `kms:CreateGrant`, `kms:DescribeKey`, and `kms:Decrypt/kms:GenerateDataKey` permissions to the IAM identity using the key to invoke Wisdom.
*
* For more information about setting up a customer managed key for Wisdom, see [Enable Amazon Connect Wisdom for your instance](https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html).
*/
public val serverSideEncryptionConfiguration: aws.sdk.kotlin.services.wisdom.model.ServerSideEncryptionConfiguration? = builder.serverSideEncryptionConfiguration
/**
* The source of the knowledge base content. Only set this argument for EXTERNAL knowledge bases.
*/
public val sourceConfiguration: aws.sdk.kotlin.services.wisdom.model.SourceConfiguration? = builder.sourceConfiguration
/**
* The tags used to organize, track, or control access for this resource.
*/
public val tags: Map? = builder.tags
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.wisdom.model.CreateKnowledgeBaseRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateKnowledgeBaseRequest(")
append("clientToken=$clientToken,")
append("description=$description,")
append("knowledgeBaseType=$knowledgeBaseType,")
append("name=$name,")
append("renderingConfiguration=$renderingConfiguration,")
append("serverSideEncryptionConfiguration=$serverSideEncryptionConfiguration,")
append("sourceConfiguration=$sourceConfiguration,")
append("tags=$tags")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = clientToken?.hashCode() ?: 0
result = 31 * result + (description?.hashCode() ?: 0)
result = 31 * result + (knowledgeBaseType.hashCode())
result = 31 * result + (name.hashCode())
result = 31 * result + (renderingConfiguration?.hashCode() ?: 0)
result = 31 * result + (serverSideEncryptionConfiguration?.hashCode() ?: 0)
result = 31 * result + (sourceConfiguration?.hashCode() ?: 0)
result = 31 * result + (tags?.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 CreateKnowledgeBaseRequest
if (clientToken != other.clientToken) return false
if (description != other.description) return false
if (knowledgeBaseType != other.knowledgeBaseType) return false
if (name != other.name) return false
if (renderingConfiguration != other.renderingConfiguration) return false
if (serverSideEncryptionConfiguration != other.serverSideEncryptionConfiguration) return false
if (sourceConfiguration != other.sourceConfiguration) return false
if (tags != other.tags) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.wisdom.model.CreateKnowledgeBaseRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see [Making retries safe with idempotent APIs](https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/).
*/
public var clientToken: kotlin.String? = null
/**
* The description.
*/
public var description: kotlin.String? = null
/**
* The type of knowledge base. Only CUSTOM knowledge bases allow you to upload your own content. EXTERNAL knowledge bases support integrations with third-party systems whose content is synchronized automatically.
*/
public var knowledgeBaseType: aws.sdk.kotlin.services.wisdom.model.KnowledgeBaseType? = null
/**
* The name of the knowledge base.
*/
public var name: kotlin.String? = null
/**
* Information about how to render the content.
*/
public var renderingConfiguration: aws.sdk.kotlin.services.wisdom.model.RenderingConfiguration? = null
/**
* The configuration information for the customer managed key used for encryption.
*
* This KMS key must have a policy that allows `kms:CreateGrant`, `kms:DescribeKey`, and `kms:Decrypt/kms:GenerateDataKey` permissions to the IAM identity using the key to invoke Wisdom.
*
* For more information about setting up a customer managed key for Wisdom, see [Enable Amazon Connect Wisdom for your instance](https://docs.aws.amazon.com/connect/latest/adminguide/enable-wisdom.html).
*/
public var serverSideEncryptionConfiguration: aws.sdk.kotlin.services.wisdom.model.ServerSideEncryptionConfiguration? = null
/**
* The source of the knowledge base content. Only set this argument for EXTERNAL knowledge bases.
*/
public var sourceConfiguration: aws.sdk.kotlin.services.wisdom.model.SourceConfiguration? = null
/**
* The tags used to organize, track, or control access for this resource.
*/
public var tags: Map? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.wisdom.model.CreateKnowledgeBaseRequest) : this() {
this.clientToken = x.clientToken
this.description = x.description
this.knowledgeBaseType = x.knowledgeBaseType
this.name = x.name
this.renderingConfiguration = x.renderingConfiguration
this.serverSideEncryptionConfiguration = x.serverSideEncryptionConfiguration
this.sourceConfiguration = x.sourceConfiguration
this.tags = x.tags
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.wisdom.model.CreateKnowledgeBaseRequest = CreateKnowledgeBaseRequest(this)
/**
* construct an [aws.sdk.kotlin.services.wisdom.model.RenderingConfiguration] inside the given [block]
*/
public fun renderingConfiguration(block: aws.sdk.kotlin.services.wisdom.model.RenderingConfiguration.Builder.() -> kotlin.Unit) {
this.renderingConfiguration = aws.sdk.kotlin.services.wisdom.model.RenderingConfiguration.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.wisdom.model.ServerSideEncryptionConfiguration] inside the given [block]
*/
public fun serverSideEncryptionConfiguration(block: aws.sdk.kotlin.services.wisdom.model.ServerSideEncryptionConfiguration.Builder.() -> kotlin.Unit) {
this.serverSideEncryptionConfiguration = aws.sdk.kotlin.services.wisdom.model.ServerSideEncryptionConfiguration.invoke(block)
}
internal fun correctErrors(): Builder {
if (knowledgeBaseType == null) knowledgeBaseType = KnowledgeBaseType.SdkUnknown("no value provided")
if (name == null) name = ""
return this
}
}
}