commonMain.aws.sdk.kotlin.services.codecatalyst.model.CreateAccessTokenResponse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codecatalyst-jvm Show documentation
Show all versions of codecatalyst-jvm Show documentation
The AWS SDK for Kotlin client for CodeCatalyst
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.codecatalyst.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
public class CreateAccessTokenResponse private constructor(builder: Builder) {
/**
* The system-generated unique ID of the access token.
*/
public val accessTokenId: kotlin.String = requireNotNull(builder.accessTokenId) { "A non-null value must be provided for accessTokenId" }
/**
* The date and time the personal access token expires, in coordinated universal time (UTC) timestamp format as specified in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339#section-5.6). If not specified, the default is one year from creation.
*/
public val expiresTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.expiresTime) { "A non-null value must be provided for expiresTime" }
/**
* The friendly name of the personal access token.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The secret value of the personal access token.
*/
public val secret: kotlin.String = requireNotNull(builder.secret) { "A non-null value must be provided for secret" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.codecatalyst.model.CreateAccessTokenResponse = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("CreateAccessTokenResponse(")
append("accessTokenId=$accessTokenId,")
append("expiresTime=$expiresTime,")
append("name=$name,")
append("secret=*** Sensitive Data Redacted ***")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = accessTokenId.hashCode()
result = 31 * result + (expiresTime.hashCode())
result = 31 * result + (name.hashCode())
result = 31 * result + (secret.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 CreateAccessTokenResponse
if (accessTokenId != other.accessTokenId) return false
if (expiresTime != other.expiresTime) return false
if (name != other.name) return false
if (secret != other.secret) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.codecatalyst.model.CreateAccessTokenResponse = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The system-generated unique ID of the access token.
*/
public var accessTokenId: kotlin.String? = null
/**
* The date and time the personal access token expires, in coordinated universal time (UTC) timestamp format as specified in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339#section-5.6). If not specified, the default is one year from creation.
*/
public var expiresTime: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The friendly name of the personal access token.
*/
public var name: kotlin.String? = null
/**
* The secret value of the personal access token.
*/
public var secret: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.codecatalyst.model.CreateAccessTokenResponse) : this() {
this.accessTokenId = x.accessTokenId
this.expiresTime = x.expiresTime
this.name = x.name
this.secret = x.secret
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.codecatalyst.model.CreateAccessTokenResponse = CreateAccessTokenResponse(this)
internal fun correctErrors(): Builder {
if (accessTokenId == null) accessTokenId = ""
if (expiresTime == null) expiresTime = Instant.fromEpochSeconds(0)
if (name == null) name = ""
if (secret == null) secret = ""
return this
}
}
}