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

commonMain.aws.sdk.kotlin.services.iotsitewise.model.Identity.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iotsitewise.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Contains an identity that can access an IoT SiteWise Monitor resource.
 *
 * Currently, you can't use Amazon Web Services API operations to retrieve IAM Identity Center identity IDs. You can find the IAM Identity Center identity IDs in the URL of user and group pages in the [IAM Identity Center console](https://console.aws.amazon.com/singlesignon).
 */
public class Identity private constructor(builder: Builder) {
    /**
     * An IAM Identity Center group identity.
     */
    public val group: aws.sdk.kotlin.services.iotsitewise.model.GroupIdentity? = builder.group
    /**
     * An IAM role identity.
     */
    public val iamRole: aws.sdk.kotlin.services.iotsitewise.model.IamRoleIdentity? = builder.iamRole
    /**
     * An IAM user identity.
     */
    public val iamUser: aws.sdk.kotlin.services.iotsitewise.model.IamUserIdentity? = builder.iamUser
    /**
     * An IAM Identity Center user identity.
     */
    public val user: aws.sdk.kotlin.services.iotsitewise.model.UserIdentity? = builder.user

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

    override fun toString(): kotlin.String = buildString {
        append("Identity(")
        append("group=$group,")
        append("iamRole=$iamRole,")
        append("iamUser=$iamUser,")
        append("user=$user")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = group?.hashCode() ?: 0
        result = 31 * result + (iamRole?.hashCode() ?: 0)
        result = 31 * result + (iamUser?.hashCode() ?: 0)
        result = 31 * result + (user?.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 Identity

        if (group != other.group) return false
        if (iamRole != other.iamRole) return false
        if (iamUser != other.iamUser) return false
        if (user != other.user) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An IAM Identity Center group identity.
         */
        public var group: aws.sdk.kotlin.services.iotsitewise.model.GroupIdentity? = null
        /**
         * An IAM role identity.
         */
        public var iamRole: aws.sdk.kotlin.services.iotsitewise.model.IamRoleIdentity? = null
        /**
         * An IAM user identity.
         */
        public var iamUser: aws.sdk.kotlin.services.iotsitewise.model.IamUserIdentity? = null
        /**
         * An IAM Identity Center user identity.
         */
        public var user: aws.sdk.kotlin.services.iotsitewise.model.UserIdentity? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iotsitewise.model.Identity) : this() {
            this.group = x.group
            this.iamRole = x.iamRole
            this.iamUser = x.iamUser
            this.user = x.user
        }

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy