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

com.pulumi.awsnative.events.kotlin.Connection.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.events.kotlin

import com.pulumi.awsnative.events.kotlin.enums.ConnectionAuthorizationType
import com.pulumi.awsnative.events.kotlin.outputs.ConnectionAuthParameters
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 com.pulumi.awsnative.events.kotlin.enums.ConnectionAuthorizationType.Companion.toKotlin as connectionAuthorizationTypeToKotlin
import com.pulumi.awsnative.events.kotlin.outputs.ConnectionAuthParameters.Companion.toKotlin as connectionAuthParametersToKotlin

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

    public var args: ConnectionArgs = ConnectionArgs()

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

/**
 * Resource Type definition for AWS::Events::Connection.
 * ## Example Usage
 * ### Example
 * No Java example available.
 */
public class Connection internal constructor(
    override val javaResource: com.pulumi.awsnative.events.Connection,
) : KotlinCustomResource(javaResource, ConnectionMapper) {
    /**
     * The arn of the connection resource.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * A `CreateConnectionAuthRequestParameters` object that contains the authorization parameters to use to authorize with the endpoint.
     */
    public val authParameters: Output
        get() = javaResource.authParameters().applyValue({ args0 ->
            args0.let({ args0 ->
                connectionAuthParametersToKotlin(args0)
            })
        })

    /**
     * The type of authorization to use for the connection.
     * > OAUTH tokens are refreshed when a 401 or 407 response is returned.
     */
    public val authorizationType: Output
        get() = javaResource.authorizationType().applyValue({ args0 ->
            args0.let({ args0 ->
                connectionAuthorizationTypeToKotlin(args0)
            })
        })

    /**
     * Description of the connection.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Name of the connection.
     */
    public val name: Output?
        get() = javaResource.name().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The arn of the secrets manager secret created in the customer account.
     */
    public val secretArn: Output
        get() = javaResource.secretArn().applyValue({ args0 -> args0 })
}

public object ConnectionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.events.Connection::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy