com.pulumi.gitlab.ProjectLabel 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.ProjectLabelArgs;
import com.pulumi.gitlab.Utilities;
import com.pulumi.gitlab.inputs.ProjectLabelState;
import java.lang.Integer;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* The `gitlab.ProjectLabel` resource allows to manage the lifecycle of a project label.
*
* **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/labels.html#project-labels)
*
* ## 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.ProjectLabel;
* import com.pulumi.gitlab.ProjectLabelArgs;
* 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 fixme = new ProjectLabel("fixme", ProjectLabelArgs.builder()
* .project("example")
* .name("fixme")
* .description("issue with failing tests")
* .color("#ffcc00")
* .build());
*
* // Scoped label
* var devopsCreate = new ProjectLabel("devopsCreate", ProjectLabelArgs.builder()
* .project(example.id())
* .name("devops::create")
* .description("issue for creating infrastructure resources")
* .color("#ffa500")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Gitlab Project labels can be imported using an id made up of `{project_id}:{group_label_id}`, e.g.
*
* ```sh
* $ pulumi import gitlab:index/projectLabel:ProjectLabel example 12345:fixme
* ```
*
*/
@ResourceType(type="gitlab:index/projectLabel:ProjectLabel")
public class ProjectLabel extends com.pulumi.resources.CustomResource {
/**
* The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords).
*
*/
@Export(name="color", refs={String.class}, tree="[0]")
private Output color;
/**
* @return The color of the label given in 6-digit hex notation with leading '#' sign (e.g. #FFAABB) or one of the [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Color_keywords).
*
*/
public Output color() {
return this.color;
}
/**
* The description of the label.
*
*/
@Export(name="description", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> description;
/**
* @return The description of the label.
*
*/
public Output> description() {
return Codegen.optional(this.description);
}
/**
* The id of the project label.
*
*/
@Export(name="labelId", refs={Integer.class}, tree="[0]")
private Output labelId;
/**
* @return The id of the project label.
*
*/
public Output labelId() {
return this.labelId;
}
/**
* The name of the label.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the label.
*
*/
public Output name() {
return this.name;
}
/**
* The name or id of the project to add the label to.
*
*/
@Export(name="project", refs={String.class}, tree="[0]")
private Output project;
/**
* @return The name or id of the project to add the label to.
*
*/
public Output project() {
return this.project;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ProjectLabel(java.lang.String name) {
this(name, ProjectLabelArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ProjectLabel(java.lang.String name, ProjectLabelArgs 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 ProjectLabel(java.lang.String name, ProjectLabelArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("gitlab:index/projectLabel:ProjectLabel", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ProjectLabel(java.lang.String name, Output id, @Nullable ProjectLabelState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("gitlab:index/projectLabel:ProjectLabel", name, state, makeResourceOptions(options, id), false);
}
private static ProjectLabelArgs makeArgs(ProjectLabelArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ProjectLabelArgs.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 ProjectLabel get(java.lang.String name, Output id, @Nullable ProjectLabelState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ProjectLabel(name, id, state, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy