sdk/java/src/main/java/com/pulumi/ovh/CloudProject/User.java
<reponame>lbrlabs/pulumi-ovh// *** 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.ovh.CloudProject;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.ovh.CloudProject.UserArgs;
import com.pulumi.ovh.CloudProject.inputs.UserState;
import com.pulumi.ovh.CloudProject.outputs.UserRole;
import com.pulumi.ovh.Utilities;
import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Creates a user in a public cloud project.
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.ovh.CloudProject.User;
 * import com.pulumi.ovh.CloudProject.UserArgs;
 * 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 user1 = new User(&#34;user1&#34;, UserArgs.builder()        
 *             .serviceName(&#34;XXX&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 */
@ResourceType(type="ovh:CloudProject/user:User")
public class User extends com.pulumi.resources.CustomResource {
    /**
     * the date the user was created.
     * 
     */
    @Export(name="creationDate", refs={String.class}, tree="[0]")
    private Output<String> creationDate;

    /**
     * @return the date the user was created.
     * 
     */
    public Output<String> creationDate() {
        return this.creationDate;
    }
    /**
     * A description associated with the user.
     * 
     */
    @Export(name="description", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> description;

    /**
     * @return A description associated with the user.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * a convenient map representing an openstack_rc file.
     * Note: no password nor sensitive token is set in this map.
     * 
     */
    @Export(name="openstackRc", refs={Map.class,String.class,Object.class}, tree="[0,1,2]")
    private Output<Map<String,Object>> openstackRc;

    /**
     * @return a convenient map representing an openstack_rc file.
     * Note: no password nor sensitive token is set in this map.
     * 
     */
    public Output<Map<String,Object>> openstackRc() {
        return this.openstackRc;
    }
    /**
     * (Sensitive) the password generated for the user. The password can
     * be used with the Openstack API. This attribute is sensitive and will only be
     * retrieve once during creation.
     * 
     */
    @Export(name="password", refs={String.class}, tree="[0]")
    private Output<String> password;

    /**
     * @return (Sensitive) the password generated for the user. The password can
     * be used with the Openstack API. This attribute is sensitive and will only be
     * retrieve once during creation.
     * 
     */
    public Output<String> password() {
        return this.password;
    }
    /**
     * The name of a role. See `role_names`.
     * 
     */
    @Export(name="roleName", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> roleName;

    /**
     * @return The name of a role. See `role_names`.
     * 
     */
    public Output<Optional<String>> roleName() {
        return Codegen.optional(this.roleName);
    }
    /**
     * A list of role names. Values can be:
     * - administrator,
     * - ai_training_operator
     * - authentication
     * - backup_operator
     * - compute_operator
     * - image_operator
     * - infrastructure_supervisor
     * - network_operator
     * - network_security_operator
     * - objectstore_operator
     * - volume_operator
     * 
     */
    @Export(name="roleNames", refs={List.class,String.class}, tree="[0,1]")
    private Output</* @Nullable */ List<String>> roleNames;

    /**
     * @return A list of role names. Values can be:
     * - administrator,
     * - ai_training_operator
     * - authentication
     * - backup_operator
     * - compute_operator
     * - image_operator
     * - infrastructure_supervisor
     * - network_operator
     * - network_security_operator
     * - objectstore_operator
     * - volume_operator
     * 
     */
    public Output<Optional<List<String>>> roleNames() {
        return Codegen.optional(this.roleNames);
    }
    /**
     * A list of roles associated with the user.
     * 
     */
    @Export(name="roles", refs={List.class,UserRole.class}, tree="[0,1]")
    private Output<List<UserRole>> roles;

    /**
     * @return A list of roles associated with the user.
     * 
     */
    public Output<List<UserRole>> roles() {
        return this.roles;
    }
    /**
     * The id of the public cloud project. If omitted,
     * the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used.
     * 
     */
    @Export(name="serviceName", refs={String.class}, tree="[0]")
    private Output<String> serviceName;

    /**
     * @return The id of the public cloud project. If omitted,
     * the `OVH_CLOUD_PROJECT_SERVICE` environment variable is used.
     * 
     */
    public Output<String> serviceName() {
        return this.serviceName;
    }
    /**
     * the status of the user. should be normally set to &#39;ok&#39;.
     * 
     */
    @Export(name="status", refs={String.class}, tree="[0]")
    private Output<String> status;

    /**
     * @return the status of the user. should be normally set to &#39;ok&#39;.
     * 
     */
    public Output<String> status() {
        return this.status;
    }
    /**
     * the username generated for the user. This username can be used with
     * the Openstack API.
     * 
     */
    @Export(name="username", refs={String.class}, tree="[0]")
    private Output<String> username;

    /**
     * @return the username generated for the user. This username can be used with
     * the Openstack API.
     * 
     */
    public Output<String> username() {
        return this.username;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public User(String name) {
        this(name, UserArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public User(String name, UserArgs 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 User(String name, UserArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("ovh:CloudProject/user:User", name, args == null ? UserArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private User(String name, Output<String> id, @Nullable UserState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("ovh:CloudProject/user:User", 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())
            .additionalSecretOutputs(List.of(
                "password"
            ))
            .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 User get(String name, Output<String> id, @Nullable UserState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new User(name, id, state, options);
    }
}
