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

commonMain.aws.sdk.kotlin.services.appsync.model.AuthorizationConfig.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.appsync.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The authorization configuration in case the HTTP endpoint requires authorization.
 */
public class AuthorizationConfig private constructor(builder: Builder) {
    /**
     * The authorization type that the HTTP endpoint requires.
     * + **AWS_IAM**: The authorization type is Signature Version 4 (SigV4).
     */
    public val authorizationType: aws.sdk.kotlin.services.appsync.model.AuthorizationType = requireNotNull(builder.authorizationType) { "A non-null value must be provided for authorizationType" }
    /**
     * The Identity and Access Management (IAM) settings.
     */
    public val awsIamConfig: aws.sdk.kotlin.services.appsync.model.AwsIamConfig? = builder.awsIamConfig

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

    override fun toString(): kotlin.String = buildString {
        append("AuthorizationConfig(")
        append("authorizationType=$authorizationType,")
        append("awsIamConfig=$awsIamConfig")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = authorizationType.hashCode()
        result = 31 * result + (awsIamConfig?.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 AuthorizationConfig

        if (authorizationType != other.authorizationType) return false
        if (awsIamConfig != other.awsIamConfig) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The authorization type that the HTTP endpoint requires.
         * + **AWS_IAM**: The authorization type is Signature Version 4 (SigV4).
         */
        public var authorizationType: aws.sdk.kotlin.services.appsync.model.AuthorizationType? = null
        /**
         * The Identity and Access Management (IAM) settings.
         */
        public var awsIamConfig: aws.sdk.kotlin.services.appsync.model.AwsIamConfig? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appsync.model.AuthorizationConfig) : this() {
            this.authorizationType = x.authorizationType
            this.awsIamConfig = x.awsIamConfig
        }

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

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

        internal fun correctErrors(): Builder {
            if (authorizationType == null) authorizationType = AuthorizationType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy