All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.github.RepositoryWebhook Maven / Gradle / Ivy

There is a newer version: 6.4.0-alpha.1731735876
Show 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.RepositoryWebhookArgs;
import com.pulumi.github.Utilities;
import com.pulumi.github.inputs.RepositoryWebhookState;
import com.pulumi.github.outputs.RepositoryWebhookConfiguration;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * This resource allows you to create and manage webhooks for repositories within your
 * GitHub organization or personal account.
 * 
 * ## Example Usage
 * ```java
 * 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.RepositoryWebhook;
 * import com.pulumi.github.RepositoryWebhookArgs;
 * import com.pulumi.github.inputs.RepositoryWebhookConfigurationArgs;
 * 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 repo = new Repository("repo", RepositoryArgs.builder()        
 *             .description("Terraform acceptance tests")
 *             .homepageUrl("http://example.com/")
 *             .visibility("public")
 *             .build());
 * 
 *         var foo = new RepositoryWebhook("foo", RepositoryWebhookArgs.builder()        
 *             .repository(repo.name())
 *             .configuration(RepositoryWebhookConfigurationArgs.builder()
 *                 .url("https://google.de/")
 *                 .contentType("form")
 *                 .insecureSsl(false)
 *                 .build())
 *             .active(false)
 *             .events("issues")
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Repository webhooks can be imported using the `name` of the repository, combined with the `id` of the webhook, separated by a `/` character. The `id` of the webhook can be found in the URL of the webhook. For example`"https://github.com/foo-org/foo-repo/settings/hooks/14711452"`.
 * 
 * Importing uses the name of the repository, as well as the ID of the webhook, e.g.
 * 
 * ```sh
 *  $ pulumi import github:index/repositoryWebhook:RepositoryWebhook terraform terraform/11235813
 * ```
 *  If secret is populated in the webhook's configuration, the value will be imported as "********".
 * 
 */
@ResourceType(type="github:index/repositoryWebhook:RepositoryWebhook")
public class RepositoryWebhook extends com.pulumi.resources.CustomResource {
    /**
     * Indicate if the webhook should receive events. Defaults to `true`.
     * 
     */
    @Export(name="active", refs={Boolean.class}, tree="[0]")
    private Output active;

    /**
     * @return Indicate if the webhook should receive events. Defaults to `true`.
     * 
     */
    public Output> active() {
        return Codegen.optional(this.active);
    }
    /**
     * Configuration block for the webhook. Detailed below.
     * 
     */
    @Export(name="configuration", refs={RepositoryWebhookConfiguration.class}, tree="[0]")
    private Output configuration;

    /**
     * @return Configuration block for the webhook. Detailed below.
     * 
     */
    public Output> configuration() {
        return Codegen.optional(this.configuration);
    }
    @Export(name="etag", refs={String.class}, tree="[0]")
    private Output etag;

    public Output etag() {
        return this.etag;
    }
    /**
     * A list of events which should trigger the webhook. See a list of [available events](https://developer.github.com/v3/activity/events/types/).
     * 
     */
    @Export(name="events", refs={List.class,String.class}, tree="[0,1]")
    private Output> events;

    /**
     * @return A list of events which should trigger the webhook. See a list of [available events](https://developer.github.com/v3/activity/events/types/).
     * 
     */
    public Output> events() {
        return this.events;
    }
    /**
     * The repository of the webhook.
     * 
     */
    @Export(name="repository", refs={String.class}, tree="[0]")
    private Output repository;

    /**
     * @return The repository of the webhook.
     * 
     */
    public Output repository() {
        return this.repository;
    }
    /**
     * The URL of the webhook.
     * 
     */
    @Export(name="url", refs={String.class}, tree="[0]")
    private Output url;

    /**
     * @return The URL of the webhook.
     * 
     */
    public Output url() {
        return this.url;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public RepositoryWebhook(String name) {
        this(name, RepositoryWebhookArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public RepositoryWebhook(String name, RepositoryWebhookArgs 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 RepositoryWebhook(String name, RepositoryWebhookArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("github:index/repositoryWebhook:RepositoryWebhook", name, args == null ? RepositoryWebhookArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private RepositoryWebhook(String name, Output id, @Nullable RepositoryWebhookState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("github:index/repositoryWebhook:RepositoryWebhook", name, state, makeResourceOptions(options, id));
    }

    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 RepositoryWebhook get(String name, Output id, @Nullable RepositoryWebhookState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new RepositoryWebhook(name, id, state, options);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy