All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.iam.model.ServiceSpecificCredentialMetadata.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 additional details about a service-specific credential.
 */
public class ServiceSpecificCredentialMetadata 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 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.
     */
    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.ServiceSpecificCredentialMetadata = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("ServiceSpecificCredentialMetadata(")
        append("createDate=$createDate,")
        append("serviceName=$serviceName,")
        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 + (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 ServiceSpecificCredentialMetadata

        if (createDate != other.createDate) return false
        if (serviceName != other.serviceName) 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.ServiceSpecificCredentialMetadata = 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 unique identifier for the service-specific credential.
         */
        public var serviceSpecificCredentialId: kotlin.String? = null
        /**
         * The generated user name for the service-specific credential.
         */
        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.ServiceSpecificCredentialMetadata) : this() {
            this.createDate = x.createDate
            this.serviceName = x.serviceName
            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.ServiceSpecificCredentialMetadata = ServiceSpecificCredentialMetadata(this)

        internal fun correctErrors(): Builder {
            if (createDate == null) createDate = Instant.fromEpochSeconds(0)
            if (serviceName == null) serviceName = ""
            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