commonMain.aws.sdk.kotlin.services.codecatalyst.model.UserIdentity.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
/**
* Information about a user whose activity is recorded in an event for a space.
*/
public class UserIdentity private constructor(builder: Builder) {
/**
* The Amazon Web Services account number of the user in Amazon Web Services, if any.
*/
public val awsAccountId: kotlin.String? = builder.awsAccountId
/**
* The ID of the Amazon CodeCatalyst service principal.
*/
public val principalId: kotlin.String = requireNotNull(builder.principalId) { "A non-null value must be provided for principalId" }
/**
* The display name of the user in Amazon CodeCatalyst.
*/
public val userName: kotlin.String? = builder.userName
/**
* The role assigned to the user in a Amazon CodeCatalyst space or project when the event occurred.
*/
public val userType: aws.sdk.kotlin.services.codecatalyst.model.UserType = requireNotNull(builder.userType) { "A non-null value must be provided for userType" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.codecatalyst.model.UserIdentity = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("UserIdentity(")
append("awsAccountId=$awsAccountId,")
append("principalId=$principalId,")
append("userName=$userName,")
append("userType=$userType")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = awsAccountId?.hashCode() ?: 0
result = 31 * result + (principalId.hashCode())
result = 31 * result + (userName?.hashCode() ?: 0)
result = 31 * result + (userType.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 UserIdentity
if (awsAccountId != other.awsAccountId) return false
if (principalId != other.principalId) return false
if (userName != other.userName) return false
if (userType != other.userType) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.codecatalyst.model.UserIdentity = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The Amazon Web Services account number of the user in Amazon Web Services, if any.
*/
public var awsAccountId: kotlin.String? = null
/**
* The ID of the Amazon CodeCatalyst service principal.
*/
public var principalId: kotlin.String? = null
/**
* The display name of the user in Amazon CodeCatalyst.
*/
public var userName: kotlin.String? = null
/**
* The role assigned to the user in a Amazon CodeCatalyst space or project when the event occurred.
*/
public var userType: aws.sdk.kotlin.services.codecatalyst.model.UserType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.codecatalyst.model.UserIdentity) : this() {
this.awsAccountId = x.awsAccountId
this.principalId = x.principalId
this.userName = x.userName
this.userType = x.userType
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.codecatalyst.model.UserIdentity = UserIdentity(this)
internal fun correctErrors(): Builder {
if (principalId == null) principalId = ""
if (userType == null) userType = UserType.SdkUnknown("no value provided")
return this
}
}
}