com.pulumi.github.IssueLabels Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of github Show documentation
Show all versions of github Show documentation
A Pulumi package for creating and managing github cloud resources.
The newest version!
// *** 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.github;
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.github.IssueLabelsArgs;
import com.pulumi.github.Utilities;
import com.pulumi.github.inputs.IssueLabelsState;
import com.pulumi.github.outputs.IssueLabelsLabel;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Provides GitHub issue labels resource.
*
* This resource allows you to create and manage issue labels within your
* GitHub organization.
*
* > Note: github.IssueLabels cannot be used in conjunction with github.IssueLabel or they will fight over what your policy should be.
*
* This resource is authoritative. For adding a label to a repo in a non-authoritative manner, use github.IssueLabel instead.
*
* If you change the case of a label's name, its' color, or description, this resource will edit the existing label to match the new values. However, if you change the name of a label, this resource will create a new label with the new name and delete the old label. Beware that this will remove the label from any issues it was previously attached to.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.github.IssueLabels;
* import com.pulumi.github.IssueLabelsArgs;
* import com.pulumi.github.inputs.IssueLabelsLabelArgs;
* 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) {
* // Create a new, red colored label
* var testRepo = new IssueLabels("testRepo", IssueLabelsArgs.builder()
* .repository("test-repo")
* .labels(
* IssueLabelsLabelArgs.builder()
* .name("Urgent")
* .color("FF0000")
* .build(),
* IssueLabelsLabelArgs.builder()
* .name("Critical")
* .color("FF0000")
* .build())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* GitHub Issue Labels can be imported using the repository `name`, e.g.
*
* ```sh
* $ pulumi import github:index/issueLabels:IssueLabels test_repo test_repo
* ```
*
*/
@ResourceType(type="github:index/issueLabels:IssueLabels")
public class IssueLabels extends com.pulumi.resources.CustomResource {
/**
* List of labels
*
*/
@Export(name="labels", refs={List.class,IssueLabelsLabel.class}, tree="[0,1]")
private Output> labels;
/**
* @return List of labels
*
*/
public Output>> labels() {
return Codegen.optional(this.labels);
}
/**
* The GitHub repository
*
*/
@Export(name="repository", refs={String.class}, tree="[0]")
private Output repository;
/**
* @return The GitHub repository
*
*/
public Output repository() {
return this.repository;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public IssueLabels(java.lang.String name) {
this(name, IssueLabelsArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public IssueLabels(java.lang.String name, IssueLabelsArgs 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 IssueLabels(java.lang.String name, IssueLabelsArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("github:index/issueLabels:IssueLabels", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private IssueLabels(java.lang.String name, Output id, @Nullable IssueLabelsState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("github:index/issueLabels:IssueLabels", name, state, makeResourceOptions(options, id), false);
}
private static IssueLabelsArgs makeArgs(IssueLabelsArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? IssueLabelsArgs.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 IssueLabels get(java.lang.String name, Output id, @Nullable IssueLabelsState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new IssueLabels(name, id, state, options);
}
}