// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.cognito;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.cognito.UserInGroupArgs;
import com.pulumi.aws.cognito.inputs.UserInGroupState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import javax.annotation.Nullable;

/**
 * Adds the specified user to the specified group.
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.cognito.UserPool;
 * import com.pulumi.aws.cognito.UserPoolArgs;
 * import com.pulumi.aws.cognito.inputs.UserPoolPasswordPolicyArgs;
 * import com.pulumi.aws.cognito.User;
 * import com.pulumi.aws.cognito.UserArgs;
 * import com.pulumi.aws.cognito.UserGroup;
 * import com.pulumi.aws.cognito.UserGroupArgs;
 * import com.pulumi.aws.cognito.UserInGroup;
 * import com.pulumi.aws.cognito.UserInGroupArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var exampleUserPool = new UserPool(&#34;exampleUserPool&#34;, UserPoolArgs.builder()        
 *             .passwordPolicy(UserPoolPasswordPolicyArgs.builder()
 *                 .temporaryPasswordValidityDays(7)
 *                 .minimumLength(6)
 *                 .requireUppercase(false)
 *                 .requireSymbols(false)
 *                 .requireNumbers(false)
 *                 .build())
 *             .build());
 * 
 *         var exampleUser = new User(&#34;exampleUser&#34;, UserArgs.builder()        
 *             .userPoolId(exampleUserPool.id())
 *             .username(&#34;example&#34;)
 *             .build());
 * 
 *         var exampleUserGroup = new UserGroup(&#34;exampleUserGroup&#34;, UserGroupArgs.builder()        
 *             .userPoolId(exampleUserPool.id())
 *             .build());
 * 
 *         var exampleUserInGroup = new UserInGroup(&#34;exampleUserInGroup&#34;, UserInGroupArgs.builder()        
 *             .userPoolId(exampleUserPool.id())
 *             .groupName(exampleUserGroup.name())
 *             .username(exampleUser.username())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 */
@ResourceType(type="aws:cognito/userInGroup:UserInGroup")
public class UserInGroup extends com.pulumi.resources.CustomResource {
    /**
     * The name of the group to which the user is to be added.
     * 
     */
    @Export(name="groupName", refs={String.class}, tree="[0]")
    private Output<String> groupName;

    /**
     * @return The name of the group to which the user is to be added.
     * 
     */
    public Output<String> groupName() {
        return this.groupName;
    }
    /**
     * The user pool ID of the user and group.
     * 
     */
    @Export(name="userPoolId", refs={String.class}, tree="[0]")
    private Output<String> userPoolId;

    /**
     * @return The user pool ID of the user and group.
     * 
     */
    public Output<String> userPoolId() {
        return this.userPoolId;
    }
    /**
     * The username of the user to be added to the group.
     * 
     */
    @Export(name="username", refs={String.class}, tree="[0]")
    private Output<String> username;

    /**
     * @return The username of the user to be added to the group.
     * 
     */
    public Output<String> username() {
        return this.username;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public UserInGroup(String name) {
        this(name, UserInGroupArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public UserInGroup(String name, UserInGroupArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public UserInGroup(String name, UserInGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("aws:cognito/userInGroup:UserInGroup", name, args == null ? UserInGroupArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private UserInGroup(String name, Output<String> id, @Nullable UserInGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("aws:cognito/userInGroup:UserInGroup", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static UserInGroup get(String name, Output<String> id, @Nullable UserInGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new UserInGroup(name, id, state, options);
    }
}
