
commonMain.aws.sdk.kotlin.services.grafana.model.CreateWorkspaceApiKeyRequest.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.grafana.model
public class CreateWorkspaceApiKeyRequest private constructor(builder: Builder) {
/**
* Specifies the name of the key to create. Key names must be unique to the workspace.
*/
public val keyName: kotlin.String? = builder.keyName
/**
* Specifies the permission level of the key.
*
* Valid Values: `VIEWER` | `EDITOR` | `ADMIN`
*/
public val keyRole: kotlin.String? = builder.keyRole
/**
* Specifies the time in seconds until the key expires. Keys can be valid for up to 30 days.
*/
public val secondsToLive: kotlin.Int? = builder.secondsToLive
/**
* The ID of the workspace in which to create an API key.
*/
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.CreateWorkspaceApiKeyRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateWorkspaceApiKeyRequest(")
append("keyName=$keyName,")
append("keyRole=$keyRole,")
append("secondsToLive=$secondsToLive,")
append("workspaceId=$workspaceId)")
}
override fun hashCode(): kotlin.Int {
var result = keyName?.hashCode() ?: 0
result = 31 * result + (keyRole?.hashCode() ?: 0)
result = 31 * result + (secondsToLive ?: 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 CreateWorkspaceApiKeyRequest
if (keyName != other.keyName) return false
if (keyRole != other.keyRole) return false
if (secondsToLive != other.secondsToLive) return false
if (workspaceId != other.workspaceId) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.grafana.model.CreateWorkspaceApiKeyRequest = Builder(this).apply(block).build()
public class Builder {
/**
* Specifies the name of the key to create. Key names must be unique to the workspace.
*/
public var keyName: kotlin.String? = null
/**
* Specifies the permission level of the key.
*
* Valid Values: `VIEWER` | `EDITOR` | `ADMIN`
*/
public var keyRole: kotlin.String? = null
/**
* Specifies the time in seconds until the key expires. Keys can be valid for up to 30 days.
*/
public var secondsToLive: kotlin.Int? = null
/**
* The ID of the workspace in which to create an API key.
*/
public var workspaceId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.grafana.model.CreateWorkspaceApiKeyRequest) : this() {
this.keyName = x.keyName
this.keyRole = x.keyRole
this.secondsToLive = x.secondsToLive
this.workspaceId = x.workspaceId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.grafana.model.CreateWorkspaceApiKeyRequest = CreateWorkspaceApiKeyRequest(this)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy