commonMain.aws.sdk.kotlin.services.grafana.model.AuthenticationDescription.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grafana-jvm Show documentation
Show all versions of grafana-jvm Show documentation
The AWS SDK for Kotlin client for grafana
// 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
}
}
}