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

commonMain.aws.sdk.kotlin.services.appsync.model.DynamodbDataSourceConfig.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

/**
 * Describes an Amazon DynamoDB data source configuration.
 */
public class DynamodbDataSourceConfig private constructor(builder: Builder) {
    /**
     * The Amazon Web Services Region.
     */
    public val awsRegion: kotlin.String = requireNotNull(builder.awsRegion) { "A non-null value must be provided for awsRegion" }
    /**
     * The `DeltaSyncConfig` for a versioned data source.
     */
    public val deltaSyncConfig: aws.sdk.kotlin.services.appsync.model.DeltaSyncConfig? = builder.deltaSyncConfig
    /**
     * The table name.
     */
    public val tableName: kotlin.String = requireNotNull(builder.tableName) { "A non-null value must be provided for tableName" }
    /**
     * Set to TRUE to use Amazon Cognito credentials with this data source.
     */
    public val useCallerCredentials: kotlin.Boolean = builder.useCallerCredentials
    /**
     * Set to TRUE to use Conflict Detection and Resolution with this data source.
     */
    public val versioned: kotlin.Boolean = builder.versioned

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

    override fun toString(): kotlin.String = buildString {
        append("DynamodbDataSourceConfig(")
        append("awsRegion=$awsRegion,")
        append("deltaSyncConfig=$deltaSyncConfig,")
        append("tableName=$tableName,")
        append("useCallerCredentials=$useCallerCredentials,")
        append("versioned=$versioned")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = awsRegion.hashCode()
        result = 31 * result + (deltaSyncConfig?.hashCode() ?: 0)
        result = 31 * result + (tableName.hashCode())
        result = 31 * result + (useCallerCredentials.hashCode())
        result = 31 * result + (versioned.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 DynamodbDataSourceConfig

        if (awsRegion != other.awsRegion) return false
        if (deltaSyncConfig != other.deltaSyncConfig) return false
        if (tableName != other.tableName) return false
        if (useCallerCredentials != other.useCallerCredentials) return false
        if (versioned != other.versioned) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Web Services Region.
         */
        public var awsRegion: kotlin.String? = null
        /**
         * The `DeltaSyncConfig` for a versioned data source.
         */
        public var deltaSyncConfig: aws.sdk.kotlin.services.appsync.model.DeltaSyncConfig? = null
        /**
         * The table name.
         */
        public var tableName: kotlin.String? = null
        /**
         * Set to TRUE to use Amazon Cognito credentials with this data source.
         */
        public var useCallerCredentials: kotlin.Boolean = false
        /**
         * Set to TRUE to use Conflict Detection and Resolution with this data source.
         */
        public var versioned: kotlin.Boolean = false

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appsync.model.DynamodbDataSourceConfig) : this() {
            this.awsRegion = x.awsRegion
            this.deltaSyncConfig = x.deltaSyncConfig
            this.tableName = x.tableName
            this.useCallerCredentials = x.useCallerCredentials
            this.versioned = x.versioned
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.appsync.model.DeltaSyncConfig] inside the given [block]
         */
        public fun deltaSyncConfig(block: aws.sdk.kotlin.services.appsync.model.DeltaSyncConfig.Builder.() -> kotlin.Unit) {
            this.deltaSyncConfig = aws.sdk.kotlin.services.appsync.model.DeltaSyncConfig.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (awsRegion == null) awsRegion = ""
            if (tableName == null) tableName = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy