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

commonMain.aws.sdk.kotlin.services.datazone.model.DomainUnitPolicyGrantPrincipal.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.datazone.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The domain unit principal to whom the policy is granted.
 */
public class DomainUnitPolicyGrantPrincipal private constructor(builder: Builder) {
    /**
     * Specifes the designation of the domain unit users.
     */
    public val domainUnitDesignation: aws.sdk.kotlin.services.datazone.model.DomainUnitDesignation = requireNotNull(builder.domainUnitDesignation) { "A non-null value must be provided for domainUnitDesignation" }
    /**
     * The grant filter for the domain unit.
     */
    public val domainUnitGrantFilter: aws.sdk.kotlin.services.datazone.model.DomainUnitGrantFilter? = builder.domainUnitGrantFilter
    /**
     * The ID of the domain unit.
     */
    public val domainUnitIdentifier: kotlin.String? = builder.domainUnitIdentifier

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

    override fun toString(): kotlin.String = buildString {
        append("DomainUnitPolicyGrantPrincipal(")
        append("domainUnitDesignation=$domainUnitDesignation,")
        append("domainUnitGrantFilter=$domainUnitGrantFilter,")
        append("domainUnitIdentifier=$domainUnitIdentifier")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = domainUnitDesignation.hashCode()
        result = 31 * result + (domainUnitGrantFilter?.hashCode() ?: 0)
        result = 31 * result + (domainUnitIdentifier?.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 DomainUnitPolicyGrantPrincipal

        if (domainUnitDesignation != other.domainUnitDesignation) return false
        if (domainUnitGrantFilter != other.domainUnitGrantFilter) return false
        if (domainUnitIdentifier != other.domainUnitIdentifier) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Specifes the designation of the domain unit users.
         */
        public var domainUnitDesignation: aws.sdk.kotlin.services.datazone.model.DomainUnitDesignation? = null
        /**
         * The grant filter for the domain unit.
         */
        public var domainUnitGrantFilter: aws.sdk.kotlin.services.datazone.model.DomainUnitGrantFilter? = null
        /**
         * The ID of the domain unit.
         */
        public var domainUnitIdentifier: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.datazone.model.DomainUnitPolicyGrantPrincipal) : this() {
            this.domainUnitDesignation = x.domainUnitDesignation
            this.domainUnitGrantFilter = x.domainUnitGrantFilter
            this.domainUnitIdentifier = x.domainUnitIdentifier
        }

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

        internal fun correctErrors(): Builder {
            if (domainUnitDesignation == null) domainUnitDesignation = DomainUnitDesignation.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy