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

commonMain.aws.sdk.kotlin.services.grafana.model.CreateWorkspaceServiceAccountTokenRequest.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 CreateWorkspaceServiceAccountTokenRequest private constructor(builder: Builder) {
    /**
     * A name for the token to create.
     */
    public val name: kotlin.String? = builder.name
    /**
     * Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
     */
    public val secondsToLive: kotlin.Int? = builder.secondsToLive
    /**
     * The ID of the service account for which to create a token.
     */
    public val serviceAccountId: kotlin.String? = builder.serviceAccountId
    /**
     * The ID of the workspace the service account resides within.
     */
    public val workspaceId: kotlin.String? = builder.workspaceId

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

    override fun toString(): kotlin.String = buildString {
        append("CreateWorkspaceServiceAccountTokenRequest(")
        append("name=$name,")
        append("secondsToLive=$secondsToLive,")
        append("serviceAccountId=$serviceAccountId,")
        append("workspaceId=$workspaceId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = name?.hashCode() ?: 0
        result = 31 * result + (secondsToLive ?: 0)
        result = 31 * result + (serviceAccountId?.hashCode() ?: 0)
        result = 31 * result + (workspaceId?.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 CreateWorkspaceServiceAccountTokenRequest

        if (name != other.name) return false
        if (secondsToLive != other.secondsToLive) return false
        if (serviceAccountId != other.serviceAccountId) return false
        if (workspaceId != other.workspaceId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A name for the token to create.
         */
        public var name: kotlin.String? = null
        /**
         * Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
         */
        public var secondsToLive: kotlin.Int? = null
        /**
         * The ID of the service account for which to create a token.
         */
        public var serviceAccountId: kotlin.String? = null
        /**
         * The ID of the workspace the service account resides within.
         */
        public var workspaceId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.grafana.model.CreateWorkspaceServiceAccountTokenRequest) : this() {
            this.name = x.name
            this.secondsToLive = x.secondsToLive
            this.serviceAccountId = x.serviceAccountId
            this.workspaceId = x.workspaceId
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy