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

commonMain.aws.sdk.kotlin.services.appsync.model.CachingConfig.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.appsync.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The caching configuration for a resolver that has caching activated.
 */
public class CachingConfig private constructor(builder: Builder) {
    /**
     * The caching keys for a resolver that has caching activated.
     *
     * Valid values are entries from the `$context.arguments`, `$context.source`, and `$context.identity` maps.
     */
    public val cachingKeys: List? = builder.cachingKeys
    /**
     * The TTL in seconds for a resolver that has caching activated.
     *
     * Valid values are 1–3,600 seconds.
     */
    public val ttl: kotlin.Long = builder.ttl

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

    override fun toString(): kotlin.String = buildString {
        append("CachingConfig(")
        append("cachingKeys=$cachingKeys,")
        append("ttl=$ttl")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = cachingKeys?.hashCode() ?: 0
        result = 31 * result + (ttl.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 CachingConfig

        if (cachingKeys != other.cachingKeys) return false
        if (ttl != other.ttl) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The caching keys for a resolver that has caching activated.
         *
         * Valid values are entries from the `$context.arguments`, `$context.source`, and `$context.identity` maps.
         */
        public var cachingKeys: List? = null
        /**
         * The TTL in seconds for a resolver that has caching activated.
         *
         * Valid values are 1–3,600 seconds.
         */
        public var ttl: kotlin.Long = 0L

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appsync.model.CachingConfig) : this() {
            this.cachingKeys = x.cachingKeys
            this.ttl = x.ttl
        }

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy