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

commonMain.aws.sdk.kotlin.services.amplifybackend.model.CreateBackendAuthResourceConfig.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.amplifybackend.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Defines the resource configuration when creating an auth resource in your Amplify project.
 */
public class CreateBackendAuthResourceConfig private constructor(builder: Builder) {
    /**
     * Defines whether you want to configure only authentication or both authentication and authorization settings.
     */
    public val authResources: aws.sdk.kotlin.services.amplifybackend.model.AuthResources? = builder.authResources
    /**
     * Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of your auth resource in the Amplify project.
     */
    public val identityPoolConfigs: aws.sdk.kotlin.services.amplifybackend.model.CreateBackendAuthIdentityPoolConfig? = builder.identityPoolConfigs
    /**
     * Defines the service name to use when configuring an authentication resource in your Amplify project.
     */
    public val service: aws.sdk.kotlin.services.amplifybackend.model.Service? = builder.service
    /**
     * Describes authentication configuration for the Amazon Cognito user pool, provisioned as a part of your auth resource in the Amplify project.
     */
    public val userPoolConfigs: aws.sdk.kotlin.services.amplifybackend.model.CreateBackendAuthUserPoolConfig? = builder.userPoolConfigs

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

    override fun toString(): kotlin.String = buildString {
        append("CreateBackendAuthResourceConfig(")
        append("authResources=$authResources,")
        append("identityPoolConfigs=$identityPoolConfigs,")
        append("service=$service,")
        append("userPoolConfigs=$userPoolConfigs")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = authResources?.hashCode() ?: 0
        result = 31 * result + (identityPoolConfigs?.hashCode() ?: 0)
        result = 31 * result + (service?.hashCode() ?: 0)
        result = 31 * result + (userPoolConfigs?.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 CreateBackendAuthResourceConfig

        if (authResources != other.authResources) return false
        if (identityPoolConfigs != other.identityPoolConfigs) return false
        if (service != other.service) return false
        if (userPoolConfigs != other.userPoolConfigs) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Defines whether you want to configure only authentication or both authentication and authorization settings.
         */
        public var authResources: aws.sdk.kotlin.services.amplifybackend.model.AuthResources? = null
        /**
         * Describes the authorization configuration for the Amazon Cognito identity pool, provisioned as a part of your auth resource in the Amplify project.
         */
        public var identityPoolConfigs: aws.sdk.kotlin.services.amplifybackend.model.CreateBackendAuthIdentityPoolConfig? = null
        /**
         * Defines the service name to use when configuring an authentication resource in your Amplify project.
         */
        public var service: aws.sdk.kotlin.services.amplifybackend.model.Service? = null
        /**
         * Describes authentication configuration for the Amazon Cognito user pool, provisioned as a part of your auth resource in the Amplify project.
         */
        public var userPoolConfigs: aws.sdk.kotlin.services.amplifybackend.model.CreateBackendAuthUserPoolConfig? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.amplifybackend.model.CreateBackendAuthResourceConfig) : this() {
            this.authResources = x.authResources
            this.identityPoolConfigs = x.identityPoolConfigs
            this.service = x.service
            this.userPoolConfigs = x.userPoolConfigs
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy