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

commonMain.aws.sdk.kotlin.services.nimble.model.NewLaunchProfileMember.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.nimble.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A new member that is added to a launch profile.
 */
public class NewLaunchProfileMember private constructor(builder: Builder) {
    /**
     * The persona.
     */
    public val persona: aws.sdk.kotlin.services.nimble.model.LaunchProfilePersona = requireNotNull(builder.persona) { "A non-null value must be provided for persona" }
    /**
     * The principal ID.
     */
    public val principalId: kotlin.String = requireNotNull(builder.principalId) { "A non-null value must be provided for principalId" }

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

    override fun toString(): kotlin.String = buildString {
        append("NewLaunchProfileMember(")
        append("persona=$persona,")
        append("principalId=$principalId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = persona.hashCode()
        result = 31 * result + (principalId.hashCode())
        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 NewLaunchProfileMember

        if (persona != other.persona) return false
        if (principalId != other.principalId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The persona.
         */
        public var persona: aws.sdk.kotlin.services.nimble.model.LaunchProfilePersona? = null
        /**
         * The principal ID.
         */
        public var principalId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.nimble.model.NewLaunchProfileMember) : this() {
            this.persona = x.persona
            this.principalId = x.principalId
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy