commonMain.aws.sdk.kotlin.services.glue.model.OAuth2PropertiesInput.kt Maven / Gradle / Ivy
// 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 in the CreateConnection request.
*/
public class OAuth2PropertiesInput private constructor(builder: Builder) {
/**
* The set of properties required for the the OAuth2 `AUTHORIZATION_CODE` grant type.
*/
public val authorizationCodeProperties: aws.sdk.kotlin.services.glue.model.AuthorizationCodeProperties? = builder.authorizationCodeProperties
/**
* The client application type in the CreateConnection request. For example, `AWS_MANAGED` or `USER_MANAGED`.
*/
public val oAuth2ClientApplication: aws.sdk.kotlin.services.glue.model.OAuth2ClientApplication? = builder.oAuth2ClientApplication
/**
* The OAuth2 grant type in the CreateConnection request. 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.OAuth2PropertiesInput = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("OAuth2PropertiesInput(")
append("authorizationCodeProperties=$authorizationCodeProperties,")
append("oAuth2ClientApplication=$oAuth2ClientApplication,")
append("oAuth2GrantType=$oAuth2GrantType,")
append("tokenUrl=$tokenUrl,")
append("tokenUrlParametersMap=$tokenUrlParametersMap")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = authorizationCodeProperties?.hashCode() ?: 0
result = 31 * 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 OAuth2PropertiesInput
if (authorizationCodeProperties != other.authorizationCodeProperties) return false
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.OAuth2PropertiesInput = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The set of properties required for the the OAuth2 `AUTHORIZATION_CODE` grant type.
*/
public var authorizationCodeProperties: aws.sdk.kotlin.services.glue.model.AuthorizationCodeProperties? = null
/**
* The client application type in the CreateConnection request. For example, `AWS_MANAGED` or `USER_MANAGED`.
*/
public var oAuth2ClientApplication: aws.sdk.kotlin.services.glue.model.OAuth2ClientApplication? = null
/**
* The OAuth2 grant type in the CreateConnection request. 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.OAuth2PropertiesInput) : this() {
this.authorizationCodeProperties = x.authorizationCodeProperties
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.OAuth2PropertiesInput = OAuth2PropertiesInput(this)
/**
* construct an [aws.sdk.kotlin.services.glue.model.AuthorizationCodeProperties] inside the given [block]
*/
public fun authorizationCodeProperties(block: aws.sdk.kotlin.services.glue.model.AuthorizationCodeProperties.Builder.() -> kotlin.Unit) {
this.authorizationCodeProperties = aws.sdk.kotlin.services.glue.model.AuthorizationCodeProperties.invoke(block)
}
/**
* 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
}
}
}