com.pulumi.gitlab.PipelineTrigger 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.PipelineTriggerArgs;
import com.pulumi.gitlab.Utilities;
import com.pulumi.gitlab.inputs.PipelineTriggerState;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import javax.annotation.Nullable;
/**
* The `gitlab.PipelineTrigger` resource allows to manage the lifecycle of a pipeline trigger.
*
* **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/ee/api/pipeline_triggers.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.PipelineTrigger;
* import com.pulumi.gitlab.PipelineTriggerArgs;
* 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 example = new PipelineTrigger("example", PipelineTriggerArgs.builder()
* .project("12345")
* .description("Used to trigger builds")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* GitLab pipeline triggers can be imported using an id made up of `{project_id}:{pipeline_trigger_id}`, e.g.
*
* ```sh
* $ pulumi import gitlab:index/pipelineTrigger:PipelineTrigger test 1:3
* ```
*
*/
@ResourceType(type="gitlab:index/pipelineTrigger:PipelineTrigger")
public class PipelineTrigger extends com.pulumi.resources.CustomResource {
/**
* The description of the pipeline trigger.
*
*/
@Export(name="description", refs={String.class}, tree="[0]")
private Output description;
/**
* @return The description of the pipeline trigger.
*
*/
public Output description() {
return this.description;
}
/**
* The pipeline trigger id.
*
*/
@Export(name="pipelineTriggerId", refs={Integer.class}, tree="[0]")
private Output pipelineTriggerId;
/**
* @return The pipeline trigger id.
*
*/
public Output pipelineTriggerId() {
return this.pipelineTriggerId;
}
/**
* The name or id of the project to add the trigger to.
*
*/
@Export(name="project", refs={String.class}, tree="[0]")
private Output project;
/**
* @return The name or id of the project to add the trigger to.
*
*/
public Output project() {
return this.project;
}
/**
* The pipeline trigger token. This value is not available during import.
*
*/
@Export(name="token", refs={String.class}, tree="[0]")
private Output token;
/**
* @return The pipeline trigger token. This value is not available during import.
*
*/
public Output token() {
return this.token;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public PipelineTrigger(java.lang.String name) {
this(name, PipelineTriggerArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public PipelineTrigger(java.lang.String name, PipelineTriggerArgs 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 PipelineTrigger(java.lang.String name, PipelineTriggerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("gitlab:index/pipelineTrigger:PipelineTrigger", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private PipelineTrigger(java.lang.String name, Output id, @Nullable PipelineTriggerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("gitlab:index/pipelineTrigger:PipelineTrigger", name, state, makeResourceOptions(options, id), false);
}
private static PipelineTriggerArgs makeArgs(PipelineTriggerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? PipelineTriggerArgs.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())
.additionalSecretOutputs(List.of(
"token"
))
.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 PipelineTrigger get(java.lang.String name, Output id, @Nullable PipelineTriggerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new PipelineTrigger(name, id, state, options);
}
}