com.pulumi.azurenative.containerregistry.kotlin.inputs.AuthInfoArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.containerregistry.kotlin.inputs
import com.pulumi.azurenative.containerregistry.inputs.AuthInfoArgs.builder
import com.pulumi.azurenative.containerregistry.kotlin.enums.TokenType
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* The authorization properties for accessing the source code repository.
* @property expiresIn Time in seconds that the token remains valid
* @property refreshToken The refresh token used to refresh the access token.
* @property scope The scope of the access token.
* @property token The access token used to access the source control provider.
* @property tokenType The type of Auth token.
*/
public data class AuthInfoArgs(
public val expiresIn: Output? = null,
public val refreshToken: Output? = null,
public val scope: Output? = null,
public val token: Output,
public val tokenType: Output>,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.containerregistry.inputs.AuthInfoArgs =
com.pulumi.azurenative.containerregistry.inputs.AuthInfoArgs.builder()
.expiresIn(expiresIn?.applyValue({ args0 -> args0 }))
.refreshToken(refreshToken?.applyValue({ args0 -> args0 }))
.scope(scope?.applyValue({ args0 -> args0 }))
.token(token.applyValue({ args0 -> args0 }))
.tokenType(
tokenType.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
).build()
}
/**
* Builder for [AuthInfoArgs].
*/
@PulumiTagMarker
public class AuthInfoArgsBuilder internal constructor() {
private var expiresIn: Output? = null
private var refreshToken: Output? = null
private var scope: Output? = null
private var token: Output? = null
private var tokenType: Output>? = null
/**
* @param value Time in seconds that the token remains valid
*/
@JvmName("klhcllcnrdwbreuq")
public suspend fun expiresIn(`value`: Output) {
this.expiresIn = value
}
/**
* @param value The refresh token used to refresh the access token.
*/
@JvmName("erxemgatmaowyavc")
public suspend fun refreshToken(`value`: Output) {
this.refreshToken = value
}
/**
* @param value The scope of the access token.
*/
@JvmName("rverjgcwmwsjtdrw")
public suspend fun scope(`value`: Output) {
this.scope = value
}
/**
* @param value The access token used to access the source control provider.
*/
@JvmName("gkapjkkiwiexvdnp")
public suspend fun token(`value`: Output) {
this.token = value
}
/**
* @param value The type of Auth token.
*/
@JvmName("gseoltifsdfgumdg")
public suspend fun tokenType(`value`: Output>) {
this.tokenType = value
}
/**
* @param value Time in seconds that the token remains valid
*/
@JvmName("wgwvebymspjkthem")
public suspend fun expiresIn(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.expiresIn = mapped
}
/**
* @param value The refresh token used to refresh the access token.
*/
@JvmName("iateljyaptfbhtop")
public suspend fun refreshToken(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.refreshToken = mapped
}
/**
* @param value The scope of the access token.
*/
@JvmName("wigjaykbenbbjkaj")
public suspend fun scope(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.scope = mapped
}
/**
* @param value The access token used to access the source control provider.
*/
@JvmName("deghawrlldlfvdal")
public suspend fun token(`value`: String) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.token = mapped
}
/**
* @param value The type of Auth token.
*/
@JvmName("cmcvfsvqlghqmjbh")
public suspend fun tokenType(`value`: Either) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.tokenType = mapped
}
/**
* @param value The type of Auth token.
*/
@JvmName("qwfcccefmladting")
public fun tokenType(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.tokenType = mapped
}
/**
* @param value The type of Auth token.
*/
@JvmName("blmnshjbshaaejwv")
public fun tokenType(`value`: TokenType) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.tokenType = mapped
}
internal fun build(): AuthInfoArgs = AuthInfoArgs(
expiresIn = expiresIn,
refreshToken = refreshToken,
scope = scope,
token = token ?: throw PulumiNullFieldException("token"),
tokenType = tokenType ?: throw PulumiNullFieldException("tokenType"),
)
}