commonMain.aws.sdk.kotlin.services.cloudsearchdomain.model.UploadDocumentsRequest.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudsearchdomain.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.content.ByteStream
/**
* Container for the parameters to the `UploadDocuments` request.
*/
public class UploadDocumentsRequest private constructor(builder: Builder) {
/**
* The format of the batch you are uploading. Amazon CloudSearch supports two document batch formats:
* + application/json
* + application/xml
*/
public val contentType: aws.sdk.kotlin.services.cloudsearchdomain.model.ContentType? = builder.contentType
/**
* A batch of documents formatted in JSON or HTML.
*/
public val documents: aws.smithy.kotlin.runtime.content.ByteStream? = builder.documents
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudsearchdomain.model.UploadDocumentsRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("UploadDocumentsRequest(")
append("contentType=$contentType,")
append("documents=$documents")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = contentType?.hashCode() ?: 0
result = 31 * result + (documents?.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 UploadDocumentsRequest
if (contentType != other.contentType) return false
if (documents != other.documents) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudsearchdomain.model.UploadDocumentsRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The format of the batch you are uploading. Amazon CloudSearch supports two document batch formats:
* + application/json
* + application/xml
*/
public var contentType: aws.sdk.kotlin.services.cloudsearchdomain.model.ContentType? = null
/**
* A batch of documents formatted in JSON or HTML.
*/
public var documents: aws.smithy.kotlin.runtime.content.ByteStream? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudsearchdomain.model.UploadDocumentsRequest) : this() {
this.contentType = x.contentType
this.documents = x.documents
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudsearchdomain.model.UploadDocumentsRequest = UploadDocumentsRequest(this)
internal fun correctErrors(): Builder {
return this
}
}
}