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

commonMain.aws.sdk.kotlin.services.cognitoidentity.model.GetCredentialsForIdentityResponse.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.cognitoidentity.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Returned in response to a successful `GetCredentialsForIdentity` operation.
 */
public class GetCredentialsForIdentityResponse private constructor(builder: Builder) {
    /**
     * Credentials for the provided identity ID.
     */
    public val credentials: aws.sdk.kotlin.services.cognitoidentity.model.Credentials? = builder.credentials
    /**
     * A unique identifier in the format REGION:GUID.
     */
    public val identityId: kotlin.String? = builder.identityId

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cognitoidentity.model.GetCredentialsForIdentityResponse = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("GetCredentialsForIdentityResponse(")
        append("credentials=$credentials,")
        append("identityId=$identityId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = credentials?.hashCode() ?: 0
        result = 31 * result + (identityId?.hashCode() ?: 0)
        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 GetCredentialsForIdentityResponse

        if (credentials != other.credentials) return false
        if (identityId != other.identityId) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cognitoidentity.model.GetCredentialsForIdentityResponse = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * Credentials for the provided identity ID.
         */
        public var credentials: aws.sdk.kotlin.services.cognitoidentity.model.Credentials? = null
        /**
         * A unique identifier in the format REGION:GUID.
         */
        public var identityId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cognitoidentity.model.GetCredentialsForIdentityResponse) : this() {
            this.credentials = x.credentials
            this.identityId = x.identityId
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.cognitoidentity.model.GetCredentialsForIdentityResponse = GetCredentialsForIdentityResponse(this)

        /**
         * construct an [aws.sdk.kotlin.services.cognitoidentity.model.Credentials] inside the given [block]
         */
        public fun credentials(block: aws.sdk.kotlin.services.cognitoidentity.model.Credentials.Builder.() -> kotlin.Unit) {
            this.credentials = aws.sdk.kotlin.services.cognitoidentity.model.Credentials.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy