commonMain.aws.sdk.kotlin.services.deadline.model.AwsCredentials.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deadline-jvm Show documentation
Show all versions of deadline-jvm Show documentation
The AWS SDK for Kotlin client for deadline
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.deadline.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
/**
* The Identity and Access Management credentials.
*/
public class AwsCredentials private constructor(builder: Builder) {
/**
* The IAM access key ID.
*/
public val accessKeyId: kotlin.String = requireNotNull(builder.accessKeyId) { "A non-null value must be provided for accessKeyId" }
/**
* The expiration date and time of the IAM credentials.
*/
public val expiration: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.expiration) { "A non-null value must be provided for expiration" }
/**
* The IAM secret access key.
*/
public val secretAccessKey: kotlin.String = requireNotNull(builder.secretAccessKey) { "A non-null value must be provided for secretAccessKey" }
/**
* The IAM session token
*/
public val sessionToken: kotlin.String = requireNotNull(builder.sessionToken) { "A non-null value must be provided for sessionToken" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.deadline.model.AwsCredentials = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("AwsCredentials(")
append("*** Sensitive Data Redacted ***")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = accessKeyId.hashCode()
result = 31 * result + (expiration.hashCode())
result = 31 * result + (secretAccessKey.hashCode())
result = 31 * result + (sessionToken.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 AwsCredentials
if (accessKeyId != other.accessKeyId) return false
if (expiration != other.expiration) return false
if (secretAccessKey != other.secretAccessKey) return false
if (sessionToken != other.sessionToken) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.deadline.model.AwsCredentials = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The IAM access key ID.
*/
public var accessKeyId: kotlin.String? = null
/**
* The expiration date and time of the IAM credentials.
*/
public var expiration: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The IAM secret access key.
*/
public var secretAccessKey: kotlin.String? = null
/**
* The IAM session token
*/
public var sessionToken: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.deadline.model.AwsCredentials) : this() {
this.accessKeyId = x.accessKeyId
this.expiration = x.expiration
this.secretAccessKey = x.secretAccessKey
this.sessionToken = x.sessionToken
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.deadline.model.AwsCredentials = AwsCredentials(this)
internal fun correctErrors(): Builder {
if (accessKeyId == null) accessKeyId = ""
if (expiration == null) expiration = Instant.fromEpochSeconds(0)
if (secretAccessKey == null) secretAccessKey = ""
if (sessionToken == null) sessionToken = ""
return this
}
}
}