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

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

@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.NetworkState
import com.pulumi.awsnative.medialive.kotlin.outputs.NetworkIpPool
import com.pulumi.awsnative.medialive.kotlin.outputs.NetworkRoute
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.List
import com.pulumi.awsnative.kotlin.outputs.Tag.Companion.toKotlin as tagToKotlin
import com.pulumi.awsnative.medialive.kotlin.enums.NetworkState.Companion.toKotlin as networkStateToKotlin
import com.pulumi.awsnative.medialive.kotlin.outputs.NetworkIpPool.Companion.toKotlin as networkIpPoolToKotlin
import com.pulumi.awsnative.medialive.kotlin.outputs.NetworkRoute.Companion.toKotlin as networkRouteToKotlin

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

    public var args: NetworkArgs = NetworkArgs()

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

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

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

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

    /**
     * The list of IP address cidr pools for the network
     */
    public val ipPools: Output>
        get() = javaResource.ipPools().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    networkIpPoolToKotlin(args0)
                })
            })
        })

    /**
     * The user-specified name of the Network to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The routes for the network
     */
    public val routes: Output>?
        get() = javaResource.routes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> networkRouteToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * The current state of the Network.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 ->
            args0.let({ args0 ->
                networkStateToKotlin(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 NetworkMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.medialive.Network::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy