com.pulumi.github.ProjectCard 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.
// *** 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.ProjectCardArgs;
import com.pulumi.github.Utilities;
import com.pulumi.github.inputs.ProjectCardState;
import java.lang.Integer;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* This resource allows you to create and manage cards for GitHub projects.
*
* ## 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.OrganizationProject;
* import com.pulumi.github.OrganizationProjectArgs;
* import com.pulumi.github.ProjectColumn;
* import com.pulumi.github.ProjectColumnArgs;
* import com.pulumi.github.ProjectCard;
* import com.pulumi.github.ProjectCardArgs;
* 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 project = new OrganizationProject("project", OrganizationProjectArgs.builder()
* .name("An Organization Project")
* .body("This is an organization project.")
* .build());
*
* var column = new ProjectColumn("column", ProjectColumnArgs.builder()
* .projectId(project.id())
* .name("Backlog")
* .build());
*
* var card = new ProjectCard("card", ProjectCardArgs.builder()
* .columnId(column.columnId())
* .note("## Unaccepted 👇")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ### Adding An Issue To A Project
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.github.Repository;
* import com.pulumi.github.RepositoryArgs;
* import com.pulumi.github.Issue;
* import com.pulumi.github.IssueArgs;
* import com.pulumi.github.RepositoryProject;
* import com.pulumi.github.RepositoryProjectArgs;
* import com.pulumi.github.ProjectColumn;
* import com.pulumi.github.ProjectColumnArgs;
* import com.pulumi.github.ProjectCard;
* import com.pulumi.github.ProjectCardArgs;
* 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 Repository("test", RepositoryArgs.builder()
* .name("myrepo")
* .hasProjects(true)
* .hasIssues(true)
* .build());
*
* var testIssue = new Issue("testIssue", IssueArgs.builder()
* .repository(test.id())
* .title("Test issue title")
* .body("Test issue body")
* .build());
*
* var testRepositoryProject = new RepositoryProject("testRepositoryProject", RepositoryProjectArgs.builder()
* .name("test")
* .repository(test.name())
* .body("this is a test project")
* .build());
*
* var testProjectColumn = new ProjectColumn("testProjectColumn", ProjectColumnArgs.builder()
* .projectId(testRepositoryProject.id())
* .name("Backlog")
* .build());
*
* var testProjectCard = new ProjectCard("testProjectCard", ProjectCardArgs.builder()
* .columnId(testProjectColumn.columnId())
* .contentId(testIssue.issueId())
* .contentType("Issue")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* A GitHub Project Card can be imported using its [Card ID](https://developer.github.com/v3/projects/cards/#get-a-project-card):
*
* ```sh
* $ pulumi import github:index/projectCard:ProjectCard card 01234567
* ```
*
*/
@ResourceType(type="github:index/projectCard:ProjectCard")
public class ProjectCard extends com.pulumi.resources.CustomResource {
/**
* The ID of the card.
*
*/
@Export(name="cardId", refs={Integer.class}, tree="[0]")
private Output cardId;
/**
* @return The ID of the card.
*
*/
public Output cardId() {
return this.cardId;
}
/**
* The ID of the card.
*
*/
@Export(name="columnId", refs={String.class}, tree="[0]")
private Output columnId;
/**
* @return The ID of the card.
*
*/
public Output columnId() {
return this.columnId;
}
/**
* `github_issue.issue_id`.
*
*/
@Export(name="contentId", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> contentId;
/**
* @return `github_issue.issue_id`.
*
*/
public Output> contentId() {
return Codegen.optional(this.contentId);
}
/**
* Must be either `Issue` or `PullRequest`
*
* **Remarks:** You must either set the `note` attribute or both `content_id` and `content_type`.
* See note example or issue example for more information.
*
*/
@Export(name="contentType", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> contentType;
/**
* @return Must be either `Issue` or `PullRequest`
*
* **Remarks:** You must either set the `note` attribute or both `content_id` and `content_type`.
* See note example or issue example for more information.
*
*/
public Output> contentType() {
return Codegen.optional(this.contentType);
}
@Export(name="etag", refs={String.class}, tree="[0]")
private Output etag;
public Output etag() {
return this.etag;
}
/**
* The note contents of the card. Markdown supported.
*
*/
@Export(name="note", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> note;
/**
* @return The note contents of the card. Markdown supported.
*
*/
public Output> note() {
return Codegen.optional(this.note);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ProjectCard(java.lang.String name) {
this(name, ProjectCardArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ProjectCard(java.lang.String name, ProjectCardArgs 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 ProjectCard(java.lang.String name, ProjectCardArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("github:index/projectCard:ProjectCard", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ProjectCard(java.lang.String name, Output id, @Nullable ProjectCardState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("github:index/projectCard:ProjectCard", name, state, makeResourceOptions(options, id), false);
}
private static ProjectCardArgs makeArgs(ProjectCardArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ProjectCardArgs.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 ProjectCard get(java.lang.String name, Output id, @Nullable ProjectCardState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ProjectCard(name, id, state, options);
}
}