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

commonMain.aws.sdk.kotlin.services.bedrockagent.model.MemoryConfiguration.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.bedrockagent.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Details of the memory configuration.
 */
public class MemoryConfiguration private constructor(builder: Builder) {
    /**
     * The type of memory that is stored.
     */
    public val enabledMemoryTypes: List = requireNotNull(builder.enabledMemoryTypes) { "A non-null value must be provided for enabledMemoryTypes" }
    /**
     * The number of days the agent is configured to retain the conversational context.
     */
    public val storageDays: kotlin.Int = builder.storageDays

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

    override fun toString(): kotlin.String = buildString {
        append("MemoryConfiguration(")
        append("enabledMemoryTypes=$enabledMemoryTypes,")
        append("storageDays=$storageDays")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = enabledMemoryTypes.hashCode()
        result = 31 * result + (storageDays)
        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 MemoryConfiguration

        if (enabledMemoryTypes != other.enabledMemoryTypes) return false
        if (storageDays != other.storageDays) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The type of memory that is stored.
         */
        public var enabledMemoryTypes: List? = null
        /**
         * The number of days the agent is configured to retain the conversational context.
         */
        public var storageDays: kotlin.Int = 30

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.bedrockagent.model.MemoryConfiguration) : this() {
            this.enabledMemoryTypes = x.enabledMemoryTypes
            this.storageDays = x.storageDays
        }

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

        internal fun correctErrors(): Builder {
            if (enabledMemoryTypes == null) enabledMemoryTypes = emptyList()
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy