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

commonMain.aws.sdk.kotlin.services.glue.model.OAuth2Properties.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.glue.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A structure containing properties for OAuth2 authentication.
 */
public class OAuth2Properties private constructor(builder: Builder) {
    /**
     * The client application type. For example, AWS_MANAGED or USER_MANAGED.
     */
    public val oAuth2ClientApplication: aws.sdk.kotlin.services.glue.model.OAuth2ClientApplication? = builder.oAuth2ClientApplication
    /**
     * The OAuth2 grant type. For example, `AUTHORIZATION_CODE`, `JWT_BEARER`, or `CLIENT_CREDENTIALS`.
     */
    public val oAuth2GrantType: aws.sdk.kotlin.services.glue.model.OAuth2GrantType? = builder.oAuth2GrantType
    /**
     * The URL of the provider's authentication server, to exchange an authorization code for an access token.
     */
    public val tokenUrl: kotlin.String? = builder.tokenUrl
    /**
     * A map of parameters that are added to the token `GET` request.
     */
    public val tokenUrlParametersMap: Map? = builder.tokenUrlParametersMap

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

    override fun toString(): kotlin.String = buildString {
        append("OAuth2Properties(")
        append("oAuth2ClientApplication=$oAuth2ClientApplication,")
        append("oAuth2GrantType=$oAuth2GrantType,")
        append("tokenUrl=$tokenUrl,")
        append("tokenUrlParametersMap=$tokenUrlParametersMap")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = oAuth2ClientApplication?.hashCode() ?: 0
        result = 31 * result + (oAuth2GrantType?.hashCode() ?: 0)
        result = 31 * result + (tokenUrl?.hashCode() ?: 0)
        result = 31 * result + (tokenUrlParametersMap?.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 OAuth2Properties

        if (oAuth2ClientApplication != other.oAuth2ClientApplication) return false
        if (oAuth2GrantType != other.oAuth2GrantType) return false
        if (tokenUrl != other.tokenUrl) return false
        if (tokenUrlParametersMap != other.tokenUrlParametersMap) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The client application type. For example, AWS_MANAGED or USER_MANAGED.
         */
        public var oAuth2ClientApplication: aws.sdk.kotlin.services.glue.model.OAuth2ClientApplication? = null
        /**
         * The OAuth2 grant type. For example, `AUTHORIZATION_CODE`, `JWT_BEARER`, or `CLIENT_CREDENTIALS`.
         */
        public var oAuth2GrantType: aws.sdk.kotlin.services.glue.model.OAuth2GrantType? = null
        /**
         * The URL of the provider's authentication server, to exchange an authorization code for an access token.
         */
        public var tokenUrl: kotlin.String? = null
        /**
         * A map of parameters that are added to the token `GET` request.
         */
        public var tokenUrlParametersMap: Map? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.OAuth2Properties) : this() {
            this.oAuth2ClientApplication = x.oAuth2ClientApplication
            this.oAuth2GrantType = x.oAuth2GrantType
            this.tokenUrl = x.tokenUrl
            this.tokenUrlParametersMap = x.tokenUrlParametersMap
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy