commonMain.aws.sdk.kotlin.services.grafana.model.CreateWorkspaceServiceAccountTokenRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grafana-jvm Show documentation
Show all versions of grafana-jvm Show documentation
The AWS SDK for Kotlin client for grafana
// 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
}
}
}