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

com.pulumi.awsnative.sso.kotlin.Assignment.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.sso.kotlin

import com.pulumi.awsnative.sso.kotlin.enums.AssignmentPrincipalType
import com.pulumi.awsnative.sso.kotlin.enums.AssignmentTargetType
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.sso.kotlin.enums.AssignmentPrincipalType.Companion.toKotlin as assignmentPrincipalTypeToKotlin
import com.pulumi.awsnative.sso.kotlin.enums.AssignmentTargetType.Companion.toKotlin as assignmentTargetTypeToKotlin

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

    public var args: AssignmentArgs = AssignmentArgs()

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

/**
 * Resource Type definition for SSO assignmet
 */
public class Assignment internal constructor(
    override val javaResource: com.pulumi.awsnative.sso.Assignment,
) : KotlinCustomResource(javaResource, AssignmentMapper) {
    /**
     * The sso instance that the permission set is owned.
     */
    public val instanceArn: Output
        get() = javaResource.instanceArn().applyValue({ args0 -> args0 })

    /**
     * The permission set that the assignemt will be assigned
     */
    public val permissionSetArn: Output
        get() = javaResource.permissionSetArn().applyValue({ args0 -> args0 })

    /**
     * The assignee's identifier, user id/group id
     */
    public val principalId: Output
        get() = javaResource.principalId().applyValue({ args0 -> args0 })

    /**
     * The assignee's type, user/group
     */
    public val principalType: Output
        get() = javaResource.principalType().applyValue({ args0 ->
            args0.let({ args0 ->
                assignmentPrincipalTypeToKotlin(args0)
            })
        })

    /**
     * The account id to be provisioned.
     */
    public val targetId: Output
        get() = javaResource.targetId().applyValue({ args0 -> args0 })

    /**
     * The type of resource to be provsioned to, only aws account now
     */
    public val targetType: Output
        get() = javaResource.targetType().applyValue({ args0 ->
            args0.let({ args0 ->
                assignmentTargetTypeToKotlin(args0)
            })
        })
}

public object AssignmentMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.sso.Assignment::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy