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

commonMain.aws.sdk.kotlin.services.grafana.model.CreateWorkspaceServiceAccountResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.grafana.model

import aws.smithy.kotlin.runtime.SdkDsl

public class CreateWorkspaceServiceAccountResponse private constructor(builder: Builder) {
    /**
     * The permission level given to the service account.
     */
    public val grafanaRole: aws.sdk.kotlin.services.grafana.model.Role = requireNotNull(builder.grafanaRole) { "A non-null value must be provided for grafanaRole" }
    /**
     * The ID of the service account.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * The name of the service account.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The workspace with which the service account is associated.
     */
    public val workspaceId: kotlin.String = requireNotNull(builder.workspaceId) { "A non-null value must be provided for workspaceId" }

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

    override fun toString(): kotlin.String = buildString {
        append("CreateWorkspaceServiceAccountResponse(")
        append("grafanaRole=$grafanaRole,")
        append("id=$id,")
        append("name=$name,")
        append("workspaceId=$workspaceId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = grafanaRole.hashCode()
        result = 31 * result + (id.hashCode())
        result = 31 * result + (name.hashCode())
        result = 31 * result + (workspaceId.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 CreateWorkspaceServiceAccountResponse

        if (grafanaRole != other.grafanaRole) return false
        if (id != other.id) return false
        if (name != other.name) return false
        if (workspaceId != other.workspaceId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The permission level given to the service account.
         */
        public var grafanaRole: aws.sdk.kotlin.services.grafana.model.Role? = null
        /**
         * The ID of the service account.
         */
        public var id: kotlin.String? = null
        /**
         * The name of the service account.
         */
        public var name: kotlin.String? = null
        /**
         * The workspace with which the service account is associated.
         */
        public var workspaceId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.grafana.model.CreateWorkspaceServiceAccountResponse) : this() {
            this.grafanaRole = x.grafanaRole
            this.id = x.id
            this.name = x.name
            this.workspaceId = x.workspaceId
        }

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

        internal fun correctErrors(): Builder {
            if (grafanaRole == null) grafanaRole = Role.SdkUnknown("no value provided")
            if (id == null) id = ""
            if (name == null) name = ""
            if (workspaceId == null) workspaceId = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy