All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.connectcases.model.CreateRelatedItemRequest.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.connectcases.model



public class CreateRelatedItemRequest private constructor(builder: Builder) {
    /**
     * A unique identifier of the case.
     */
    public val caseId: kotlin.String = requireNotNull(builder.caseId) { "A non-null value must be provided for caseId" }
    /**
     * The content of a related item to be created.
     */
    public val content: aws.sdk.kotlin.services.connectcases.model.RelatedItemInputContent? = builder.content
    /**
     * The unique identifier of the Cases domain.
     */
    public val domainId: kotlin.String = requireNotNull(builder.domainId) { "A non-null value must be provided for domainId" }
    /**
     * Represents the creator of the related item.
     */
    public val performedBy: aws.sdk.kotlin.services.connectcases.model.UserUnion? = builder.performedBy
    /**
     * The type of a related item.
     */
    public val type: aws.sdk.kotlin.services.connectcases.model.RelatedItemType = requireNotNull(builder.type) { "A non-null value must be provided for type" }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.connectcases.model.CreateRelatedItemRequest = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("CreateRelatedItemRequest(")
        append("caseId=$caseId,")
        append("content=$content,")
        append("domainId=$domainId,")
        append("performedBy=$performedBy,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = caseId.hashCode()
        result = 31 * result + (content?.hashCode() ?: 0)
        result = 31 * result + (domainId.hashCode())
        result = 31 * result + (performedBy?.hashCode() ?: 0)
        result = 31 * result + (type.hashCode())
        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 CreateRelatedItemRequest

        if (caseId != other.caseId) return false
        if (content != other.content) return false
        if (domainId != other.domainId) return false
        if (performedBy != other.performedBy) return false
        if (type != other.type) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.connectcases.model.CreateRelatedItemRequest = Builder(this).apply(block).build()

    public class Builder {
        /**
         * A unique identifier of the case.
         */
        public var caseId: kotlin.String? = null
        /**
         * The content of a related item to be created.
         */
        public var content: aws.sdk.kotlin.services.connectcases.model.RelatedItemInputContent? = null
        /**
         * The unique identifier of the Cases domain.
         */
        public var domainId: kotlin.String? = null
        /**
         * Represents the creator of the related item.
         */
        public var performedBy: aws.sdk.kotlin.services.connectcases.model.UserUnion? = null
        /**
         * The type of a related item.
         */
        public var type: aws.sdk.kotlin.services.connectcases.model.RelatedItemType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.connectcases.model.CreateRelatedItemRequest) : this() {
            this.caseId = x.caseId
            this.content = x.content
            this.domainId = x.domainId
            this.performedBy = x.performedBy
            this.type = x.type
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.connectcases.model.CreateRelatedItemRequest = CreateRelatedItemRequest(this)

        internal fun correctErrors(): Builder {
            if (caseId == null) caseId = ""
            if (domainId == null) domainId = ""
            if (type == null) type = RelatedItemType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy