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

commonMain.aws.sdk.kotlin.services.grafana.model.AuthenticationDescription.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.grafana.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A structure containing information about the user authentication methods used by the workspace.
 */
public class AuthenticationDescription private constructor(builder: Builder) {
    /**
     * A structure containing information about how this workspace works with IAM Identity Center.
     */
    public val awsSso: aws.sdk.kotlin.services.grafana.model.AwsSsoAuthentication? = builder.awsSso
    /**
     * Specifies whether this workspace uses IAM Identity Center, SAML, or both methods to authenticate users to use the Grafana console in the Amazon Managed Grafana workspace.
     */
    public val providers: List = requireNotNull(builder.providers) { "A non-null value must be provided for providers" }
    /**
     * A structure containing information about how this workspace works with SAML, including what attributes within the assertion are to be mapped to user information in the workspace.
     */
    public val saml: aws.sdk.kotlin.services.grafana.model.SamlAuthentication? = builder.saml

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

    override fun toString(): kotlin.String = buildString {
        append("AuthenticationDescription(")
        append("awsSso=$awsSso,")
        append("providers=$providers,")
        append("saml=$saml")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = awsSso?.hashCode() ?: 0
        result = 31 * result + (providers.hashCode())
        result = 31 * result + (saml?.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 AuthenticationDescription

        if (awsSso != other.awsSso) return false
        if (providers != other.providers) return false
        if (saml != other.saml) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A structure containing information about how this workspace works with IAM Identity Center.
         */
        public var awsSso: aws.sdk.kotlin.services.grafana.model.AwsSsoAuthentication? = null
        /**
         * Specifies whether this workspace uses IAM Identity Center, SAML, or both methods to authenticate users to use the Grafana console in the Amazon Managed Grafana workspace.
         */
        public var providers: List? = null
        /**
         * A structure containing information about how this workspace works with SAML, including what attributes within the assertion are to be mapped to user information in the workspace.
         */
        public var saml: aws.sdk.kotlin.services.grafana.model.SamlAuthentication? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.grafana.model.AuthenticationDescription) : this() {
            this.awsSso = x.awsSso
            this.providers = x.providers
            this.saml = x.saml
        }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy