commonMain.aws.sdk.kotlin.services.comprehend.model.CreateDocumentClassifierRequest.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 CreateDocumentClassifierRequest 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
/**
* The name of the document classifier.
*/
public val documentClassifierName: kotlin.String? = builder.documentClassifierName
/**
* Specifies the format and location of the input data for the job.
*/
public val inputDataConfig: aws.sdk.kotlin.services.comprehend.model.DocumentClassifierInputDataConfig? = builder.inputDataConfig
/**
* The language of the input documents. You can specify any of the languages supported by Amazon Comprehend. All documents must be in the same language.
*/
public val languageCode: aws.sdk.kotlin.services.comprehend.model.LanguageCode? = builder.languageCode
/**
* Indicates the mode in which the classifier will be trained. The classifier can be trained in multi-class (single-label) mode or multi-label mode. Multi-class mode identifies a single class label for each document and multi-label mode identifies one or more class labels for each document. Multiple labels for an individual document are separated by a delimiter. The default delimiter between labels is a pipe (|).
*/
public val mode: aws.sdk.kotlin.services.comprehend.model.DocumentClassifierMode? = builder.mode
/**
* 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 resource-based policy to attach to your custom document classifier model. You can use this policy to allow another Amazon Web Services account to import your custom model.
*
* Provide your policy as a JSON body that you enter as a UTF-8 encoded string without line breaks. To provide valid JSON, 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
/**
* Specifies the location for the output files from a custom classifier job. This parameter is required for a request that creates a native document model.
*/
public val outputDataConfig: aws.sdk.kotlin.services.comprehend.model.DocumentClassifierOutputDataConfig? = builder.outputDataConfig
/**
* Tags to associate with the document classifier. 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 classifier. Version names can have a maximum of 256 characters. Alphanumeric characters, hyphens (-) and underscores (_) are allowed. The version name must be unique among all models with the same classifier name in the Amazon Web Services account/Amazon Web Services 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 classifier. 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.CreateDocumentClassifierRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateDocumentClassifierRequest(")
append("clientRequestToken=$clientRequestToken,")
append("dataAccessRoleArn=$dataAccessRoleArn,")
append("documentClassifierName=$documentClassifierName,")
append("inputDataConfig=$inputDataConfig,")
append("languageCode=$languageCode,")
append("mode=$mode,")
append("modelKmsKeyId=$modelKmsKeyId,")
append("modelPolicy=$modelPolicy,")
append("outputDataConfig=$outputDataConfig,")
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 + (documentClassifierName?.hashCode() ?: 0)
result = 31 * result + (inputDataConfig?.hashCode() ?: 0)
result = 31 * result + (languageCode?.hashCode() ?: 0)
result = 31 * result + (mode?.hashCode() ?: 0)
result = 31 * result + (modelKmsKeyId?.hashCode() ?: 0)
result = 31 * result + (modelPolicy?.hashCode() ?: 0)
result = 31 * result + (outputDataConfig?.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 CreateDocumentClassifierRequest
if (clientRequestToken != other.clientRequestToken) return false
if (dataAccessRoleArn != other.dataAccessRoleArn) return false
if (documentClassifierName != other.documentClassifierName) return false
if (inputDataConfig != other.inputDataConfig) return false
if (languageCode != other.languageCode) return false
if (mode != other.mode) return false
if (modelKmsKeyId != other.modelKmsKeyId) return false
if (modelPolicy != other.modelPolicy) return false
if (outputDataConfig != other.outputDataConfig) 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.CreateDocumentClassifierRequest = 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
/**
* The name of the document classifier.
*/
public var documentClassifierName: kotlin.String? = null
/**
* Specifies the format and location of the input data for the job.
*/
public var inputDataConfig: aws.sdk.kotlin.services.comprehend.model.DocumentClassifierInputDataConfig? = null
/**
* The language of the input documents. You can specify any of the languages supported by Amazon Comprehend. All documents must be in the same language.
*/
public var languageCode: aws.sdk.kotlin.services.comprehend.model.LanguageCode? = null
/**
* Indicates the mode in which the classifier will be trained. The classifier can be trained in multi-class (single-label) mode or multi-label mode. Multi-class mode identifies a single class label for each document and multi-label mode identifies one or more class labels for each document. Multiple labels for an individual document are separated by a delimiter. The default delimiter between labels is a pipe (|).
*/
public var mode: aws.sdk.kotlin.services.comprehend.model.DocumentClassifierMode? = 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 resource-based policy to attach to your custom document classifier model. You can use this policy to allow another Amazon Web Services account to import your custom model.
*
* Provide your policy as a JSON body that you enter as a UTF-8 encoded string without line breaks. To provide valid JSON, 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
/**
* Specifies the location for the output files from a custom classifier job. This parameter is required for a request that creates a native document model.
*/
public var outputDataConfig: aws.sdk.kotlin.services.comprehend.model.DocumentClassifierOutputDataConfig? = null
/**
* Tags to associate with the document classifier. 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 classifier. Version names can have a maximum of 256 characters. Alphanumeric characters, hyphens (-) and underscores (_) are allowed. The version name must be unique among all models with the same classifier name in the Amazon Web Services account/Amazon Web Services 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 classifier. 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.CreateDocumentClassifierRequest) : this() {
this.clientRequestToken = x.clientRequestToken
this.dataAccessRoleArn = x.dataAccessRoleArn
this.documentClassifierName = x.documentClassifierName
this.inputDataConfig = x.inputDataConfig
this.languageCode = x.languageCode
this.mode = x.mode
this.modelKmsKeyId = x.modelKmsKeyId
this.modelPolicy = x.modelPolicy
this.outputDataConfig = x.outputDataConfig
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.CreateDocumentClassifierRequest = CreateDocumentClassifierRequest(this)
/**
* construct an [aws.sdk.kotlin.services.comprehend.model.DocumentClassifierInputDataConfig] inside the given [block]
*/
public fun inputDataConfig(block: aws.sdk.kotlin.services.comprehend.model.DocumentClassifierInputDataConfig.Builder.() -> kotlin.Unit) {
this.inputDataConfig = aws.sdk.kotlin.services.comprehend.model.DocumentClassifierInputDataConfig.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.comprehend.model.DocumentClassifierOutputDataConfig] inside the given [block]
*/
public fun outputDataConfig(block: aws.sdk.kotlin.services.comprehend.model.DocumentClassifierOutputDataConfig.Builder.() -> kotlin.Unit) {
this.outputDataConfig = aws.sdk.kotlin.services.comprehend.model.DocumentClassifierOutputDataConfig.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
}
}
}