commonMain.aws.sdk.kotlin.services.comprehend.model.CreateEntityRecognizerRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of comprehend-jvm Show documentation
Show all versions of comprehend-jvm Show documentation
The AWS SDK for Kotlin client for Comprehend
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.comprehend.model
import aws.smithy.kotlin.runtime.SdkDsl
public class CreateEntityRecognizerRequest private constructor(builder: Builder) {
/**
* A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.
*/
public val clientRequestToken: kotlin.String? = builder.clientRequestToken
/**
* The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to your input data.
*/
public val dataAccessRoleArn: kotlin.String? = builder.dataAccessRoleArn
/**
* Specifies the format and location of the input data. The S3 bucket containing the input data must be located in the same Region as the entity recognizer being created.
*/
public val inputDataConfig: aws.sdk.kotlin.services.comprehend.model.EntityRecognizerInputDataConfig? = builder.inputDataConfig
/**
* You can specify any of the following languages: English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), German ("de"), or Portuguese ("pt"). If you plan to use this entity recognizer with PDF, Word, or image input files, you must specify English as the language. All training documents must be in the same language.
*/
public val languageCode: aws.sdk.kotlin.services.comprehend.model.LanguageCode? = builder.languageCode
/**
* ID for the KMS key that Amazon Comprehend uses to encrypt trained custom models. The ModelKmsKeyId can be either of the following formats:
* + KMS Key ID: `"1234abcd-12ab-34cd-56ef-1234567890ab"`
* + Amazon Resource Name (ARN) of a KMS Key: `"arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"`
*/
public val modelKmsKeyId: kotlin.String? = builder.modelKmsKeyId
/**
* The JSON resource-based policy to attach to your custom entity recognizer model. You can use this policy to allow another Amazon Web Services account to import your custom model.
*
* Provide your JSON as a UTF-8 encoded string without line breaks. To provide valid JSON for your policy, enclose the attribute names and values in double quotes. If the JSON body is also enclosed in double quotes, then you must escape the double quotes that are inside the policy:
*
* `"{\"attribute\": \"value\", \"attribute\": [\"value\"]}"`
*
* To avoid escaping quotes, you can use single quotes to enclose the policy and double quotes to enclose the JSON names and values:
*
* `'{"attribute": "value", "attribute": ["value"]}'`
*/
public val modelPolicy: kotlin.String? = builder.modelPolicy
/**
* The name given to the newly created recognizer. Recognizer names can be a maximum of 256 characters. Alphanumeric characters, hyphens (-) and underscores (_) are allowed. The name must be unique in the account/Region.
*/
public val recognizerName: kotlin.String? = builder.recognizerName
/**
* Tags to associate with the entity recognizer. A tag is a key-value pair that adds as a metadata to a resource used by Amazon Comprehend. For example, a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.
*/
public val tags: List? = builder.tags
/**
* The version name given to the newly created recognizer. Version names can be a maximum of 256 characters. Alphanumeric characters, hyphens (-) and underscores (_) are allowed. The version name must be unique among all models with the same recognizer name in the account/Region.
*/
public val versionName: kotlin.String? = builder.versionName
/**
* ID for the Amazon Web Services Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that process the analysis job. The VolumeKmsKeyId can be either of the following formats:
* + KMS Key ID: `"1234abcd-12ab-34cd-56ef-1234567890ab"`
* + Amazon Resource Name (ARN) of a KMS Key: `"arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"`
*/
public val volumeKmsKeyId: kotlin.String? = builder.volumeKmsKeyId
/**
* Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your custom entity recognizer. For more information, see [Amazon VPC](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html).
*/
public val vpcConfig: aws.sdk.kotlin.services.comprehend.model.VpcConfig? = builder.vpcConfig
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.comprehend.model.CreateEntityRecognizerRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateEntityRecognizerRequest(")
append("clientRequestToken=$clientRequestToken,")
append("dataAccessRoleArn=$dataAccessRoleArn,")
append("inputDataConfig=$inputDataConfig,")
append("languageCode=$languageCode,")
append("modelKmsKeyId=$modelKmsKeyId,")
append("modelPolicy=$modelPolicy,")
append("recognizerName=$recognizerName,")
append("tags=$tags,")
append("versionName=$versionName,")
append("volumeKmsKeyId=$volumeKmsKeyId,")
append("vpcConfig=$vpcConfig")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = clientRequestToken?.hashCode() ?: 0
result = 31 * result + (dataAccessRoleArn?.hashCode() ?: 0)
result = 31 * result + (inputDataConfig?.hashCode() ?: 0)
result = 31 * result + (languageCode?.hashCode() ?: 0)
result = 31 * result + (modelKmsKeyId?.hashCode() ?: 0)
result = 31 * result + (modelPolicy?.hashCode() ?: 0)
result = 31 * result + (recognizerName?.hashCode() ?: 0)
result = 31 * result + (tags?.hashCode() ?: 0)
result = 31 * result + (versionName?.hashCode() ?: 0)
result = 31 * result + (volumeKmsKeyId?.hashCode() ?: 0)
result = 31 * result + (vpcConfig?.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 CreateEntityRecognizerRequest
if (clientRequestToken != other.clientRequestToken) return false
if (dataAccessRoleArn != other.dataAccessRoleArn) return false
if (inputDataConfig != other.inputDataConfig) return false
if (languageCode != other.languageCode) return false
if (modelKmsKeyId != other.modelKmsKeyId) return false
if (modelPolicy != other.modelPolicy) return false
if (recognizerName != other.recognizerName) return false
if (tags != other.tags) return false
if (versionName != other.versionName) return false
if (volumeKmsKeyId != other.volumeKmsKeyId) return false
if (vpcConfig != other.vpcConfig) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.comprehend.model.CreateEntityRecognizerRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.
*/
public var clientRequestToken: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to your input data.
*/
public var dataAccessRoleArn: kotlin.String? = null
/**
* Specifies the format and location of the input data. The S3 bucket containing the input data must be located in the same Region as the entity recognizer being created.
*/
public var inputDataConfig: aws.sdk.kotlin.services.comprehend.model.EntityRecognizerInputDataConfig? = null
/**
* You can specify any of the following languages: English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), German ("de"), or Portuguese ("pt"). If you plan to use this entity recognizer with PDF, Word, or image input files, you must specify English as the language. All training documents must be in the same language.
*/
public var languageCode: aws.sdk.kotlin.services.comprehend.model.LanguageCode? = null
/**
* ID for the KMS key that Amazon Comprehend uses to encrypt trained custom models. The ModelKmsKeyId can be either of the following formats:
* + KMS Key ID: `"1234abcd-12ab-34cd-56ef-1234567890ab"`
* + Amazon Resource Name (ARN) of a KMS Key: `"arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"`
*/
public var modelKmsKeyId: kotlin.String? = null
/**
* The JSON resource-based policy to attach to your custom entity recognizer model. You can use this policy to allow another Amazon Web Services account to import your custom model.
*
* Provide your JSON as a UTF-8 encoded string without line breaks. To provide valid JSON for your policy, enclose the attribute names and values in double quotes. If the JSON body is also enclosed in double quotes, then you must escape the double quotes that are inside the policy:
*
* `"{\"attribute\": \"value\", \"attribute\": [\"value\"]}"`
*
* To avoid escaping quotes, you can use single quotes to enclose the policy and double quotes to enclose the JSON names and values:
*
* `'{"attribute": "value", "attribute": ["value"]}'`
*/
public var modelPolicy: kotlin.String? = null
/**
* The name given to the newly created recognizer. Recognizer names can be a maximum of 256 characters. Alphanumeric characters, hyphens (-) and underscores (_) are allowed. The name must be unique in the account/Region.
*/
public var recognizerName: kotlin.String? = null
/**
* Tags to associate with the entity recognizer. A tag is a key-value pair that adds as a metadata to a resource used by Amazon Comprehend. For example, a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.
*/
public var tags: List? = null
/**
* The version name given to the newly created recognizer. Version names can be a maximum of 256 characters. Alphanumeric characters, hyphens (-) and underscores (_) are allowed. The version name must be unique among all models with the same recognizer name in the account/Region.
*/
public var versionName: kotlin.String? = null
/**
* ID for the Amazon Web Services Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that process the analysis job. The VolumeKmsKeyId can be either of the following formats:
* + KMS Key ID: `"1234abcd-12ab-34cd-56ef-1234567890ab"`
* + Amazon Resource Name (ARN) of a KMS Key: `"arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"`
*/
public var volumeKmsKeyId: kotlin.String? = null
/**
* Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your custom entity recognizer. For more information, see [Amazon VPC](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html).
*/
public var vpcConfig: aws.sdk.kotlin.services.comprehend.model.VpcConfig? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.comprehend.model.CreateEntityRecognizerRequest) : this() {
this.clientRequestToken = x.clientRequestToken
this.dataAccessRoleArn = x.dataAccessRoleArn
this.inputDataConfig = x.inputDataConfig
this.languageCode = x.languageCode
this.modelKmsKeyId = x.modelKmsKeyId
this.modelPolicy = x.modelPolicy
this.recognizerName = x.recognizerName
this.tags = x.tags
this.versionName = x.versionName
this.volumeKmsKeyId = x.volumeKmsKeyId
this.vpcConfig = x.vpcConfig
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.comprehend.model.CreateEntityRecognizerRequest = CreateEntityRecognizerRequest(this)
/**
* construct an [aws.sdk.kotlin.services.comprehend.model.EntityRecognizerInputDataConfig] inside the given [block]
*/
public fun inputDataConfig(block: aws.sdk.kotlin.services.comprehend.model.EntityRecognizerInputDataConfig.Builder.() -> kotlin.Unit) {
this.inputDataConfig = aws.sdk.kotlin.services.comprehend.model.EntityRecognizerInputDataConfig.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.comprehend.model.VpcConfig] inside the given [block]
*/
public fun vpcConfig(block: aws.sdk.kotlin.services.comprehend.model.VpcConfig.Builder.() -> kotlin.Unit) {
this.vpcConfig = aws.sdk.kotlin.services.comprehend.model.VpcConfig.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}