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

com.pulumi.awsnative.pcaconnectorscep.kotlin.Connector.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.pcaconnectorscep.kotlin

import com.pulumi.awsnative.pcaconnectorscep.kotlin.enums.ConnectorType
import com.pulumi.awsnative.pcaconnectorscep.kotlin.outputs.ConnectorMobileDeviceManagement
import com.pulumi.awsnative.pcaconnectorscep.kotlin.outputs.ConnectorOpenIdConfiguration
import com.pulumi.core.Output
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
import kotlin.collections.Map
import com.pulumi.awsnative.pcaconnectorscep.kotlin.enums.ConnectorType.Companion.toKotlin as connectorTypeToKotlin
import com.pulumi.awsnative.pcaconnectorscep.kotlin.outputs.ConnectorMobileDeviceManagement.Companion.toKotlin as connectorMobileDeviceManagementToKotlin
import com.pulumi.awsnative.pcaconnectorscep.kotlin.outputs.ConnectorOpenIdConfiguration.Companion.toKotlin as connectorOpenIdConfigurationToKotlin

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

    public var args: ConnectorArgs = ConnectorArgs()

    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 ConnectorArgsBuilder.() -> Unit) {
        val builder = ConnectorArgsBuilder()
        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(): Connector {
        val builtJavaResource = com.pulumi.awsnative.pcaconnectorscep.Connector(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Connector(builtJavaResource)
    }
}

/**
 * Represents a Connector that allows certificate issuance through Simple Certificate Enrollment Protocol (SCEP)
 */
public class Connector internal constructor(
    override val javaResource: com.pulumi.awsnative.pcaconnectorscep.Connector,
) : KotlinCustomResource(javaResource, ConnectorMapper) {
    public val certificateAuthorityArn: Output
        get() = javaResource.certificateAuthorityArn().applyValue({ args0 -> args0 })

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

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

    public val mobileDeviceManagement: Output?
        get() = javaResource.mobileDeviceManagement().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> connectorMobileDeviceManagementToKotlin(args0) })
            }).orElse(null)
        })

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

    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

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

public object ConnectorMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.pcaconnectorscep.Connector::class == javaResource::class

    override fun map(javaResource: Resource): Connector = Connector(
        javaResource as
            com.pulumi.awsnative.pcaconnectorscep.Connector,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy