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

commonMain.aws.sdk.kotlin.services.iot.model.Sigv4Authorization.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iot.model



/**
 * For more information, see [Signature Version 4 signing process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
 */
public class Sigv4Authorization private constructor(builder: Builder) {
    /**
     * The ARN of the signing role.
     */
    public val roleArn: kotlin.String = requireNotNull(builder.roleArn) { "A non-null value must be provided for roleArn" }
    /**
     * The service name to use while signing with Sig V4.
     */
    public val serviceName: kotlin.String = requireNotNull(builder.serviceName) { "A non-null value must be provided for serviceName" }
    /**
     * The signing region.
     */
    public val signingRegion: kotlin.String = requireNotNull(builder.signingRegion) { "A non-null value must be provided for signingRegion" }

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

    override fun toString(): kotlin.String = buildString {
        append("Sigv4Authorization(")
        append("roleArn=$roleArn,")
        append("serviceName=$serviceName,")
        append("signingRegion=$signingRegion")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = roleArn.hashCode()
        result = 31 * result + (serviceName.hashCode())
        result = 31 * result + (signingRegion.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 Sigv4Authorization

        if (roleArn != other.roleArn) return false
        if (serviceName != other.serviceName) return false
        if (signingRegion != other.signingRegion) return false

        return true
    }

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

    public class Builder {
        /**
         * The ARN of the signing role.
         */
        public var roleArn: kotlin.String? = null
        /**
         * The service name to use while signing with Sig V4.
         */
        public var serviceName: kotlin.String? = null
        /**
         * The signing region.
         */
        public var signingRegion: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.Sigv4Authorization) : this() {
            this.roleArn = x.roleArn
            this.serviceName = x.serviceName
            this.signingRegion = x.signingRegion
        }

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

        internal fun correctErrors(): Builder {
            if (roleArn == null) roleArn = ""
            if (serviceName == null) serviceName = ""
            if (signingRegion == null) signingRegion = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy