com.pulumi.gitlab.ProjectMembership Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gitlab Show documentation
Show all versions of gitlab Show documentation
A Pulumi package for creating and managing GitLab resources.
// *** 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.gitlab;
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.gitlab.ProjectMembershipArgs;
import com.pulumi.gitlab.Utilities;
import com.pulumi.gitlab.inputs.ProjectMembershipState;
import java.lang.Integer;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* The `gitlab.ProjectMembership` resource allows to manage the lifecycle of a users project membership.
*
* > If a project should grant membership to an entire group use the `gitlab.ProjectShareGroup` resource instead.
*
* **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/members.html)
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gitlab.ProjectMembership;
* import com.pulumi.gitlab.ProjectMembershipArgs;
* 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 test = new ProjectMembership("test", ProjectMembershipArgs.builder()
* .project("12345")
* .userId(1337)
* .accessLevel("guest")
* .build());
*
* var example = new ProjectMembership("example", ProjectMembershipArgs.builder()
* .project("67890")
* .userId(1234)
* .accessLevel("guest")
* .expiresAt("2022-12-31")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* GitLab project membership can be imported using an id made up of `project_id:user_id`, e.g.
*
* ```sh
* $ pulumi import gitlab:index/projectMembership:ProjectMembership test "12345:1337"
* ```
*
*/
@ResourceType(type="gitlab:index/projectMembership:ProjectMembership")
public class ProjectMembership extends com.pulumi.resources.CustomResource {
/**
* The access level for the member. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `owner`
*
*/
@Export(name="accessLevel", refs={String.class}, tree="[0]")
private Output accessLevel;
/**
* @return The access level for the member. Valid values are: `no one`, `minimal`, `guest`, `reporter`, `developer`, `maintainer`, `owner`
*
*/
public Output accessLevel() {
return this.accessLevel;
}
/**
* Expiration date for the project membership. Format: `YYYY-MM-DD`
*
*/
@Export(name="expiresAt", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> expiresAt;
/**
* @return Expiration date for the project membership. Format: `YYYY-MM-DD`
*
*/
public Output> expiresAt() {
return Codegen.optional(this.expiresAt);
}
/**
* The ID or URL-encoded path of the project.
*
*/
@Export(name="project", refs={String.class}, tree="[0]")
private Output project;
/**
* @return The ID or URL-encoded path of the project.
*
*/
public Output project() {
return this.project;
}
/**
* The id of the user.
*
*/
@Export(name="userId", refs={Integer.class}, tree="[0]")
private Output userId;
/**
* @return The id of the user.
*
*/
public Output userId() {
return this.userId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ProjectMembership(java.lang.String name) {
this(name, ProjectMembershipArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ProjectMembership(java.lang.String name, ProjectMembershipArgs 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 ProjectMembership(java.lang.String name, ProjectMembershipArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("gitlab:index/projectMembership:ProjectMembership", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ProjectMembership(java.lang.String name, Output id, @Nullable ProjectMembershipState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("gitlab:index/projectMembership:ProjectMembership", name, state, makeResourceOptions(options, id), false);
}
private static ProjectMembershipArgs makeArgs(ProjectMembershipArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ProjectMembershipArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output 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 ProjectMembership get(java.lang.String name, Output id, @Nullable ProjectMembershipState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ProjectMembership(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy