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

com.pulumi.googlenative.identitytoolkit.v2.kotlin.OauthIdpConfig.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.identitytoolkit.v2.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.identitytoolkit.v2.kotlin.outputs.GoogleCloudIdentitytoolkitAdminV2OAuthResponseTypeResponse
import com.pulumi.googlenative.identitytoolkit.v2.kotlin.outputs.GoogleCloudIdentitytoolkitAdminV2OAuthResponseTypeResponse.Companion.toKotlin
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [OauthIdpConfig].
 */
@PulumiTagMarker
public class OauthIdpConfigResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: OauthIdpConfigArgs = OauthIdpConfigArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend OauthIdpConfigArgsBuilder.() -> Unit) {
        val builder = OauthIdpConfigArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): OauthIdpConfig {
        val builtJavaResource =
            com.pulumi.googlenative.identitytoolkit.v2.OauthIdpConfig(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return OauthIdpConfig(builtJavaResource)
    }
}

/**
 * Create an Oidc Idp configuration for an Identity Toolkit project.
 */
public class OauthIdpConfig internal constructor(
    override val javaResource: com.pulumi.googlenative.identitytoolkit.v2.OauthIdpConfig,
) : KotlinCustomResource(javaResource, OauthIdpConfigMapper) {
    /**
     * The client id of an OAuth client.
     */
    public val clientId: Output
        get() = javaResource.clientId().applyValue({ args0 -> args0 })

    /**
     * The client secret of the OAuth client, to enable OIDC code flow.
     */
    public val clientSecret: Output
        get() = javaResource.clientSecret().applyValue({ args0 -> args0 })

    /**
     * The config's display name set by developers.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * True if allows the user to sign in with the provider.
     */
    public val enabled: Output
        get() = javaResource.enabled().applyValue({ args0 -> args0 })

    /**
     * For OIDC Idps, the issuer identifier.
     */
    public val issuer: Output
        get() = javaResource.issuer().applyValue({ args0 -> args0 })

    /**
     * The name of the OAuthIdpConfig resource, for example: 'projects/my-awesome-project/oauthIdpConfigs/oauth-config-id'. Ignored during create requests.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The id to use for this config.
     */
    public val oauthIdpConfigId: Output?
        get() = javaResource.oauthIdpConfigId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The response type to request for in the OAuth authorization flow. You can set either `id_token` or `code` to true, but not both. Setting both types to be simultaneously true (`{code: true, id_token: true}`) is not yet supported.
     */
    public val responseType: Output
        get() = javaResource.responseType().applyValue({ args0 -> args0.let({ args0 -> toKotlin(args0) }) })

    public val tenantId: Output
        get() = javaResource.tenantId().applyValue({ args0 -> args0 })
}

public object OauthIdpConfigMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.identitytoolkit.v2.OauthIdpConfig::class == javaResource::class

    override fun map(javaResource: Resource): OauthIdpConfig = OauthIdpConfig(
        javaResource as
            com.pulumi.googlenative.identitytoolkit.v2.OauthIdpConfig,
    )
}

/**
 * @see [OauthIdpConfig].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [OauthIdpConfig].
 */
public suspend fun oauthIdpConfig(
    name: String,
    block: suspend OauthIdpConfigResourceBuilder.() -> Unit,
): OauthIdpConfig {
    val builder = OauthIdpConfigResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [OauthIdpConfig].
 * @param name The _unique_ name of the resulting resource.
 */
public fun oauthIdpConfig(name: String): OauthIdpConfig {
    val builder = OauthIdpConfigResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy