commonMain.aws.sdk.kotlin.services.appflow.model.OAuth2Properties.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appflow-jvm Show documentation
Show all versions of appflow-jvm Show documentation
The AWS SDK for Kotlin client for Appflow
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 2.0 properties required for OAuth 2.0 authentication.
*/
public class OAuth2Properties private constructor(builder: Builder) {
/**
* The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.
*/
public val oAuth2GrantType: aws.sdk.kotlin.services.appflow.model.OAuth2GrantType = requireNotNull(builder.oAuth2GrantType) { "A non-null value must be provided for oAuth2GrantType" }
/**
* The token URL required for OAuth 2.0 authentication.
*/
public val tokenUrl: kotlin.String = requireNotNull(builder.tokenUrl) { "A non-null value must be provided for tokenUrl" }
/**
* Associates your token URL with a map of properties that you define. Use this parameter to provide any additional details that the connector requires to authenticate your request.
*/
public val tokenUrlCustomProperties: Map? = builder.tokenUrlCustomProperties
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.appflow.model.OAuth2Properties = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("OAuth2Properties(")
append("oAuth2GrantType=$oAuth2GrantType,")
append("tokenUrl=$tokenUrl,")
append("tokenUrlCustomProperties=$tokenUrlCustomProperties")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = oAuth2GrantType.hashCode()
result = 31 * result + (tokenUrl.hashCode())
result = 31 * result + (tokenUrlCustomProperties?.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 (oAuth2GrantType != other.oAuth2GrantType) return false
if (tokenUrl != other.tokenUrl) return false
if (tokenUrlCustomProperties != other.tokenUrlCustomProperties) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.appflow.model.OAuth2Properties = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The OAuth 2.0 grant type used by connector for OAuth 2.0 authentication.
*/
public var oAuth2GrantType: aws.sdk.kotlin.services.appflow.model.OAuth2GrantType? = null
/**
* The token URL required for OAuth 2.0 authentication.
*/
public var tokenUrl: kotlin.String? = null
/**
* Associates your token URL with a map of properties that you define. Use this parameter to provide any additional details that the connector requires to authenticate your request.
*/
public var tokenUrlCustomProperties: Map? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.appflow.model.OAuth2Properties) : this() {
this.oAuth2GrantType = x.oAuth2GrantType
this.tokenUrl = x.tokenUrl
this.tokenUrlCustomProperties = x.tokenUrlCustomProperties
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.appflow.model.OAuth2Properties = OAuth2Properties(this)
internal fun correctErrors(): Builder {
if (oAuth2GrantType == null) oAuth2GrantType = OAuth2GrantType.SdkUnknown("no value provided")
if (tokenUrl == null) tokenUrl = ""
return this
}
}
}