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

commonMain.aws.sdk.kotlin.services.appflow.model.OAuthProperties.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.appflow.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The OAuth properties required for OAuth type authentication.
 */
public class OAuthProperties private constructor(builder: Builder) {
    /**
     * The authorization code url required to redirect to SAP Login Page to fetch authorization code for OAuth type authentication.
     */
    public val authCodeUrl: kotlin.String = requireNotNull(builder.authCodeUrl) { "A non-null value must be provided for authCodeUrl" }
    /**
     * The OAuth scopes required for OAuth type authentication.
     */
    public val oAuthScopes: List = requireNotNull(builder.oAuthScopes) { "A non-null value must be provided for oAuthScopes" }
    /**
     * The token url required to fetch access/refresh tokens using authorization code and also to refresh expired access token using refresh token.
     */
    public val tokenUrl: kotlin.String = requireNotNull(builder.tokenUrl) { "A non-null value must be provided for tokenUrl" }

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

    override fun toString(): kotlin.String = buildString {
        append("OAuthProperties(")
        append("authCodeUrl=$authCodeUrl,")
        append("oAuthScopes=$oAuthScopes,")
        append("tokenUrl=$tokenUrl")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = authCodeUrl.hashCode()
        result = 31 * result + (oAuthScopes.hashCode())
        result = 31 * result + (tokenUrl.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 OAuthProperties

        if (authCodeUrl != other.authCodeUrl) return false
        if (oAuthScopes != other.oAuthScopes) return false
        if (tokenUrl != other.tokenUrl) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The authorization code url required to redirect to SAP Login Page to fetch authorization code for OAuth type authentication.
         */
        public var authCodeUrl: kotlin.String? = null
        /**
         * The OAuth scopes required for OAuth type authentication.
         */
        public var oAuthScopes: List? = null
        /**
         * The token url required to fetch access/refresh tokens using authorization code and also to refresh expired access token using refresh token.
         */
        public var tokenUrl: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.appflow.model.OAuthProperties) : this() {
            this.authCodeUrl = x.authCodeUrl
            this.oAuthScopes = x.oAuthScopes
            this.tokenUrl = x.tokenUrl
        }

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

        internal fun correctErrors(): Builder {
            if (authCodeUrl == null) authCodeUrl = ""
            if (oAuthScopes == null) oAuthScopes = emptyList()
            if (tokenUrl == null) tokenUrl = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy