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

com.pulumi.awsnative.guardduty.kotlin.Master.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.guardduty.kotlin

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

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

    public var args: MasterArgs = MasterArgs()

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

/**
 * GuardDuty Master resource schema
 */
public class Master internal constructor(
    override val javaResource: com.pulumi.awsnative.guardduty.Master,
) : KotlinCustomResource(javaResource, MasterMapper) {
    /**
     * Unique ID of the detector of the GuardDuty member account.
     */
    public val detectorId: Output
        get() = javaResource.detectorId().applyValue({ args0 -> args0 })

    /**
     * Value used to validate the master account to the member account.
     */
    public val invitationId: Output?
        get() = javaResource.invitationId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * ID of the account used as the master account.
     */
    public val masterId: Output
        get() = javaResource.masterId().applyValue({ args0 -> args0 })
}

public object MasterMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.guardduty.Master::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy