
commonMain.aws.sdk.kotlin.services.cloudfront.model.PublicKeySummary.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudfront.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
/**
* Contains information about a public key.
*/
public class PublicKeySummary private constructor(builder: Builder) {
/**
* A comment to describe the public key. The comment cannot be longer than 128 characters.
*/
public val comment: kotlin.String? = builder.comment
/**
* The date and time when the public key was uploaded.
*/
public val createdTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createdTime) { "A non-null value must be provided for createdTime" }
/**
* The public key.
*/
public val encodedKey: kotlin.String = requireNotNull(builder.encodedKey) { "A non-null value must be provided for encodedKey" }
/**
* The identifier of the public key.
*/
public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
/**
* A name to help identify the public key.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudfront.model.PublicKeySummary = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PublicKeySummary(")
append("comment=$comment,")
append("createdTime=$createdTime,")
append("encodedKey=$encodedKey,")
append("id=$id,")
append("name=$name")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = comment?.hashCode() ?: 0
result = 31 * result + (createdTime.hashCode())
result = 31 * result + (encodedKey.hashCode())
result = 31 * result + (id.hashCode())
result = 31 * result + (name.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 PublicKeySummary
if (comment != other.comment) return false
if (createdTime != other.createdTime) return false
if (encodedKey != other.encodedKey) return false
if (id != other.id) return false
if (name != other.name) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudfront.model.PublicKeySummary = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A comment to describe the public key. The comment cannot be longer than 128 characters.
*/
public var comment: kotlin.String? = null
/**
* The date and time when the public key was uploaded.
*/
public var createdTime: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The public key.
*/
public var encodedKey: kotlin.String? = null
/**
* The identifier of the public key.
*/
public var id: kotlin.String? = null
/**
* A name to help identify the public key.
*/
public var name: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudfront.model.PublicKeySummary) : this() {
this.comment = x.comment
this.createdTime = x.createdTime
this.encodedKey = x.encodedKey
this.id = x.id
this.name = x.name
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudfront.model.PublicKeySummary = PublicKeySummary(this)
internal fun correctErrors(): Builder {
if (createdTime == null) createdTime = Instant.fromEpochSeconds(0)
if (encodedKey == null) encodedKey = ""
if (id == null) id = ""
if (name == null) name = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy