commonMain.aws.sdk.kotlin.services.grafana.model.CreateWorkspaceApiKeyResponse.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 CreateWorkspaceApiKeyResponse private constructor(builder: Builder) {
/**
* The key token. Use this value as a bearer token to authenticate HTTP requests to the workspace.
*/
public val key: kotlin.String = requireNotNull(builder.key) { "A non-null value must be provided for key" }
/**
* The name of the key that was created.
*/
public val keyName: kotlin.String = requireNotNull(builder.keyName) { "A non-null value must be provided for keyName" }
/**
* The ID of the workspace that the key is valid for.
*/
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.CreateWorkspaceApiKeyResponse = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateWorkspaceApiKeyResponse(")
append("key=*** Sensitive Data Redacted ***,")
append("keyName=$keyName,")
append("workspaceId=$workspaceId")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = key.hashCode()
result = 31 * result + (keyName.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 CreateWorkspaceApiKeyResponse
if (key != other.key) return false
if (keyName != other.keyName) return false
if (workspaceId != other.workspaceId) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.grafana.model.CreateWorkspaceApiKeyResponse = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The key token. Use this value as a bearer token to authenticate HTTP requests to the workspace.
*/
public var key: kotlin.String? = null
/**
* The name of the key that was created.
*/
public var keyName: kotlin.String? = null
/**
* The ID of the workspace that the key is valid for.
*/
public var workspaceId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.grafana.model.CreateWorkspaceApiKeyResponse) : this() {
this.key = x.key
this.keyName = x.keyName
this.workspaceId = x.workspaceId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.grafana.model.CreateWorkspaceApiKeyResponse = CreateWorkspaceApiKeyResponse(this)
internal fun correctErrors(): Builder {
if (key == null) key = ""
if (keyName == null) keyName = ""
if (workspaceId == null) workspaceId = ""
return this
}
}
}