
commonMain.aws.sdk.kotlin.services.iam.model.ServiceSpecificCredential.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.iam.model
import aws.smithy.kotlin.runtime.time.Instant
/**
* Contains the details of a service-specific credential.
*/
public class ServiceSpecificCredential private constructor(builder: Builder) {
/**
* The date and time, in [ISO 8601 date-time format](http://www.iso.org/iso/iso8601), when the service-specific credential were created.
*/
public val createDate: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createDate) { "A non-null value must be provided for createDate" }
/**
* The name of the service associated with the service-specific credential.
*/
public val serviceName: kotlin.String = requireNotNull(builder.serviceName) { "A non-null value must be provided for serviceName" }
/**
* The generated password for the service-specific credential.
*/
public val servicePassword: kotlin.String = requireNotNull(builder.servicePassword) { "A non-null value must be provided for servicePassword" }
/**
* The unique identifier for the service-specific credential.
*/
public val serviceSpecificCredentialId: kotlin.String = requireNotNull(builder.serviceSpecificCredentialId) { "A non-null value must be provided for serviceSpecificCredentialId" }
/**
* The generated user name for the service-specific credential. This value is generated by combining the IAM user's name combined with the ID number of the Amazon Web Services account, as in `jane-at-123456789012`, for example. This value cannot be configured by the user.
*/
public val serviceUserName: kotlin.String = requireNotNull(builder.serviceUserName) { "A non-null value must be provided for serviceUserName" }
/**
* The status of the service-specific credential. `Active` means that the key is valid for API calls, while `Inactive` means it is not.
*/
public val status: aws.sdk.kotlin.services.iam.model.StatusType = requireNotNull(builder.status) { "A non-null value must be provided for status" }
/**
* The name of the IAM user associated with the service-specific credential.
*/
public val userName: kotlin.String = requireNotNull(builder.userName) { "A non-null value must be provided for userName" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.iam.model.ServiceSpecificCredential = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ServiceSpecificCredential(")
append("createDate=$createDate,")
append("serviceName=$serviceName,")
append("servicePassword=*** Sensitive Data Redacted ***,")
append("serviceSpecificCredentialId=$serviceSpecificCredentialId,")
append("serviceUserName=$serviceUserName,")
append("status=$status,")
append("userName=$userName")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = createDate.hashCode()
result = 31 * result + (serviceName.hashCode())
result = 31 * result + (servicePassword.hashCode())
result = 31 * result + (serviceSpecificCredentialId.hashCode())
result = 31 * result + (serviceUserName.hashCode())
result = 31 * result + (status.hashCode())
result = 31 * result + (userName.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 ServiceSpecificCredential
if (createDate != other.createDate) return false
if (serviceName != other.serviceName) return false
if (servicePassword != other.servicePassword) return false
if (serviceSpecificCredentialId != other.serviceSpecificCredentialId) return false
if (serviceUserName != other.serviceUserName) return false
if (status != other.status) return false
if (userName != other.userName) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.iam.model.ServiceSpecificCredential = Builder(this).apply(block).build()
public class Builder {
/**
* The date and time, in [ISO 8601 date-time format](http://www.iso.org/iso/iso8601), when the service-specific credential were created.
*/
public var createDate: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* The name of the service associated with the service-specific credential.
*/
public var serviceName: kotlin.String? = null
/**
* The generated password for the service-specific credential.
*/
public var servicePassword: kotlin.String? = null
/**
* The unique identifier for the service-specific credential.
*/
public var serviceSpecificCredentialId: kotlin.String? = null
/**
* The generated user name for the service-specific credential. This value is generated by combining the IAM user's name combined with the ID number of the Amazon Web Services account, as in `jane-at-123456789012`, for example. This value cannot be configured by the user.
*/
public var serviceUserName: kotlin.String? = null
/**
* The status of the service-specific credential. `Active` means that the key is valid for API calls, while `Inactive` means it is not.
*/
public var status: aws.sdk.kotlin.services.iam.model.StatusType? = null
/**
* The name of the IAM user associated with the service-specific credential.
*/
public var userName: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.iam.model.ServiceSpecificCredential) : this() {
this.createDate = x.createDate
this.serviceName = x.serviceName
this.servicePassword = x.servicePassword
this.serviceSpecificCredentialId = x.serviceSpecificCredentialId
this.serviceUserName = x.serviceUserName
this.status = x.status
this.userName = x.userName
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.iam.model.ServiceSpecificCredential = ServiceSpecificCredential(this)
internal fun correctErrors(): Builder {
if (createDate == null) createDate = Instant.fromEpochSeconds(0)
if (serviceName == null) serviceName = ""
if (servicePassword == null) servicePassword = ""
if (serviceSpecificCredentialId == null) serviceSpecificCredentialId = ""
if (serviceUserName == null) serviceUserName = ""
if (status == null) status = StatusType.SdkUnknown("no value provided")
if (userName == null) userName = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy