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

commonMain.aws.sdk.kotlin.services.opensearch.model.AuthorizedPrincipal.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.opensearch.model



/**
 * Information about an Amazon Web Services account or service that has access to an Amazon OpenSearch Service domain through the use of an interface VPC endpoint.
 */
public class AuthorizedPrincipal private constructor(builder: Builder) {
    /**
     * The [IAM principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) that is allowed access to the domain.
     */
    public val principal: kotlin.String? = builder.principal
    /**
     * The type of principal.
     */
    public val principalType: aws.sdk.kotlin.services.opensearch.model.PrincipalType? = builder.principalType

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

    override fun toString(): kotlin.String = buildString {
        append("AuthorizedPrincipal(")
        append("principal=$principal,")
        append("principalType=$principalType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = principal?.hashCode() ?: 0
        result = 31 * result + (principalType?.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 AuthorizedPrincipal

        if (principal != other.principal) return false
        if (principalType != other.principalType) return false

        return true
    }

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

    public class Builder {
        /**
         * The [IAM principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) that is allowed access to the domain.
         */
        public var principal: kotlin.String? = null
        /**
         * The type of principal.
         */
        public var principalType: aws.sdk.kotlin.services.opensearch.model.PrincipalType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.opensearch.model.AuthorizedPrincipal) : this() {
            this.principal = x.principal
            this.principalType = x.principalType
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy