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

com.pulumi.awsnative.cognito.kotlin.UserPoolUserToGroupAttachment.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.cognito.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 [UserPoolUserToGroupAttachment].
 */
@PulumiTagMarker
public class UserPoolUserToGroupAttachmentResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: UserPoolUserToGroupAttachmentArgs = UserPoolUserToGroupAttachmentArgs()

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

/**
 * Resource Type definition for AWS::Cognito::UserPoolUserToGroupAttachment
 */
public class UserPoolUserToGroupAttachment internal constructor(
    override val javaResource: com.pulumi.awsnative.cognito.UserPoolUserToGroupAttachment,
) : KotlinCustomResource(javaResource, UserPoolUserToGroupAttachmentMapper) {
    /**
     * The name of the group that you want to add your user to.
     */
    public val groupName: Output
        get() = javaResource.groupName().applyValue({ args0 -> args0 })

    /**
     * The user pool ID for the user pool.
     */
    public val userPoolId: Output
        get() = javaResource.userPoolId().applyValue({ args0 -> args0 })

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

public object UserPoolUserToGroupAttachmentMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.awsnative.cognito.UserPoolUserToGroupAttachment::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy