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

com.pulumi.awsnative.medialive.kotlin.Multiplex.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.medialive.kotlin

import com.pulumi.awsnative.kotlin.outputs.Tag
import com.pulumi.awsnative.medialive.kotlin.enums.MultiplexState
import com.pulumi.awsnative.medialive.kotlin.outputs.MultiplexOutputDestination
import com.pulumi.awsnative.medialive.kotlin.outputs.MultiplexSettings
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.medialive.kotlin.enums.MultiplexState.Companion.toKotlin as multiplexStateToKotlin
import com.pulumi.awsnative.medialive.kotlin.outputs.MultiplexOutputDestination.Companion.toKotlin as multiplexOutputDestinationToKotlin
import com.pulumi.awsnative.medialive.kotlin.outputs.MultiplexSettings.Companion.toKotlin as multiplexSettingsToKotlin

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

    public var args: MultiplexArgs = MultiplexArgs()

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

/**
 * Resource schema for AWS::MediaLive::Multiplex
 */
public class Multiplex internal constructor(
    override val javaResource: com.pulumi.awsnative.medialive.Multiplex,
) : KotlinCustomResource(javaResource, MultiplexMapper) {
    /**
     * The unique arn of the multiplex.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * A list of availability zones for the multiplex.
     */
    public val availabilityZones: Output>
        get() = javaResource.availabilityZones().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The unique id of the multiplex.
     */
    public val awsId: Output
        get() = javaResource.awsId().applyValue({ args0 -> args0 })

    /**
     * A list of the multiplex output destinations.
     */
    public val destinations: Output>?
        get() = javaResource.destinations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> multiplexOutputDestinationToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * Configuration for a multiplex event.
     */
    public val multiplexSettings: Output
        get() = javaResource.multiplexSettings().applyValue({ args0 ->
            args0.let({ args0 ->
                multiplexSettingsToKotlin(args0)
            })
        })

    /**
     * Name of multiplex.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The number of currently healthy pipelines.
     */
    public val pipelinesRunningCount: Output
        get() = javaResource.pipelinesRunningCount().applyValue({ args0 -> args0 })

    /**
     * The number of programs in the multiplex.
     */
    public val programCount: Output
        get() = javaResource.programCount().applyValue({ args0 -> args0 })

    /**
     * The current state of the multiplex.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 ->
            args0.let({ args0 ->
                multiplexStateToKotlin(args0)
            })
        })

    /**
     * A collection of key-value pairs.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> tagToKotlin(args0) })
                })
            }).orElse(null)
        })
}

public object MultiplexMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.medialive.Multiplex::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy