// *** 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.gcp.cloudbuild;

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.gcp.Utilities;
import com.pulumi.gcp.cloudbuild.BitbucketServerConfigArgs;
import com.pulumi.gcp.cloudbuild.inputs.BitbucketServerConfigState;
import com.pulumi.gcp.cloudbuild.outputs.BitbucketServerConfigConnectedRepository;
import com.pulumi.gcp.cloudbuild.outputs.BitbucketServerConfigSecrets;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * BitbucketServerConfig represents the configuration for a Bitbucket Server.
 * 
 * To get more information about BitbucketServerConfig, see:
 * 
 * * [API documentation](https://cloud.google.com/build/docs/api/reference/rest/v1/projects.locations.bitbucketServerConfigs)
 * * How-to Guides
 *     * [Connect to a Bitbucket Server host](https://cloud.google.com/build/docs/automating-builds/bitbucket/connect-host-bitbucket-server)
 * 
 * ## Example Usage
 * ### Cloudbuild Bitbucket Server Config
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.cloudbuild.BitbucketServerConfig;
 * import com.pulumi.gcp.cloudbuild.BitbucketServerConfigArgs;
 * import com.pulumi.gcp.cloudbuild.inputs.BitbucketServerConfigSecretsArgs;
 * 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 bbs_config = new BitbucketServerConfig(&#34;bbs-config&#34;, BitbucketServerConfigArgs.builder()        
 *             .apiKey(&#34;&lt;api-key&gt;&#34;)
 *             .configId(&#34;bbs-config&#34;)
 *             .hostUri(&#34;https://bbs.com&#34;)
 *             .location(&#34;us-central1&#34;)
 *             .secrets(BitbucketServerConfigSecretsArgs.builder()
 *                 .adminAccessTokenVersionName(&#34;projects/myProject/secrets/mybbspat/versions/1&#34;)
 *                 .readAccessTokenVersionName(&#34;projects/myProject/secrets/mybbspat/versions/1&#34;)
 *                 .webhookSecretVersionName(&#34;projects/myProject/secrets/mybbspat/versions/1&#34;)
 *                 .build())
 *             .username(&#34;test&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * ### Cloudbuild Bitbucket Server Config Repositories
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.cloudbuild.BitbucketServerConfig;
 * import com.pulumi.gcp.cloudbuild.BitbucketServerConfigArgs;
 * import com.pulumi.gcp.cloudbuild.inputs.BitbucketServerConfigConnectedRepositoryArgs;
 * import com.pulumi.gcp.cloudbuild.inputs.BitbucketServerConfigSecretsArgs;
 * 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 bbs_config_with_repos = new BitbucketServerConfig(&#34;bbs-config-with-repos&#34;, BitbucketServerConfigArgs.builder()        
 *             .apiKey(&#34;&lt;api-key&gt;&#34;)
 *             .configId(&#34;bbs-config&#34;)
 *             .connectedRepositories(            
 *                 BitbucketServerConfigConnectedRepositoryArgs.builder()
 *                     .projectKey(&#34;DEV&#34;)
 *                     .repoSlug(&#34;repo1&#34;)
 *                     .build(),
 *                 BitbucketServerConfigConnectedRepositoryArgs.builder()
 *                     .projectKey(&#34;PROD&#34;)
 *                     .repoSlug(&#34;repo1&#34;)
 *                     .build())
 *             .hostUri(&#34;https://bbs.com&#34;)
 *             .location(&#34;us-central1&#34;)
 *             .secrets(BitbucketServerConfigSecretsArgs.builder()
 *                 .adminAccessTokenVersionName(&#34;projects/myProject/secrets/mybbspat/versions/1&#34;)
 *                 .readAccessTokenVersionName(&#34;projects/myProject/secrets/mybbspat/versions/1&#34;)
 *                 .webhookSecretVersionName(&#34;projects/myProject/secrets/mybbspat/versions/1&#34;)
 *                 .build())
 *             .username(&#34;test&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * BitbucketServerConfig can be imported using any of these accepted formats
 * 
 * ```sh
 *  $ pulumi import gcp:cloudbuild/bitbucketServerConfig:BitbucketServerConfig default projects/{{project}}/locations/{{location}}/bitbucketServerConfigs/{{config_id}}
 * ```
 * 
 * ```sh
 *  $ pulumi import gcp:cloudbuild/bitbucketServerConfig:BitbucketServerConfig default {{project}}/{{location}}/{{config_id}}
 * ```
 * 
 * ```sh
 *  $ pulumi import gcp:cloudbuild/bitbucketServerConfig:BitbucketServerConfig default {{location}}/{{config_id}}
 * ```
 * 
 */
@ResourceType(type="gcp:cloudbuild/bitbucketServerConfig:BitbucketServerConfig")
public class BitbucketServerConfig extends com.pulumi.resources.CustomResource {
    /**
     * Immutable. API Key that will be attached to webhook. Once this field has been set, it cannot be changed.
     * Changing this field will result in deleting/ recreating the resource.
     * 
     */
    @Export(name="apiKey", type=String.class, parameters={})
    private Output<String> apiKey;

    /**
     * @return Immutable. API Key that will be attached to webhook. Once this field has been set, it cannot be changed.
     * Changing this field will result in deleting/ recreating the resource.
     * 
     */
    public Output<String> apiKey() {
        return this.apiKey;
    }
    /**
     * The ID to use for the BitbucketServerConfig, which will become the final component of the BitbucketServerConfig&#39;s resource name.
     * 
     */
    @Export(name="configId", type=String.class, parameters={})
    private Output<String> configId;

    /**
     * @return The ID to use for the BitbucketServerConfig, which will become the final component of the BitbucketServerConfig&#39;s resource name.
     * 
     */
    public Output<String> configId() {
        return this.configId;
    }
    /**
     * Connected Bitbucket Server repositories for this config.
     * Structure is documented below.
     * 
     */
    @Export(name="connectedRepositories", type=List.class, parameters={BitbucketServerConfigConnectedRepository.class})
    private Output</* @Nullable */ List<BitbucketServerConfigConnectedRepository>> connectedRepositories;

    /**
     * @return Connected Bitbucket Server repositories for this config.
     * Structure is documented below.
     * 
     */
    public Output<Optional<List<BitbucketServerConfigConnectedRepository>>> connectedRepositories() {
        return Codegen.optional(this.connectedRepositories);
    }
    /**
     * Immutable. The URI of the Bitbucket Server host. Once this field has been set, it cannot be changed.
     * If you need to change it, please create another BitbucketServerConfig.
     * 
     */
    @Export(name="hostUri", type=String.class, parameters={})
    private Output<String> hostUri;

    /**
     * @return Immutable. The URI of the Bitbucket Server host. Once this field has been set, it cannot be changed.
     * If you need to change it, please create another BitbucketServerConfig.
     * 
     */
    public Output<String> hostUri() {
        return this.hostUri;
    }
    /**
     * The location of this bitbucket server config.
     * 
     */
    @Export(name="location", type=String.class, parameters={})
    private Output<String> location;

    /**
     * @return The location of this bitbucket server config.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * The resource name for the config.
     * 
     */
    @Export(name="name", type=String.class, parameters={})
    private Output<String> name;

    /**
     * @return The resource name for the config.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The network to be used when reaching out to the Bitbucket Server instance. The VPC network must be enabled for private service connection.
     * This should be set if the Bitbucket Server instance is hosted on-premises and not reachable by public internet. If this field is left empty,
     * no network peering will occur and calls to the Bitbucket Server instance will be made over the public internet. Must be in the format
     * projects/{project}/global/networks/{network}, where {project} is a project number or id and {network} is the name of a VPC network in the project.
     * 
     */
    @Export(name="peeredNetwork", type=String.class, parameters={})
    private Output</* @Nullable */ String> peeredNetwork;

    /**
     * @return The network to be used when reaching out to the Bitbucket Server instance. The VPC network must be enabled for private service connection.
     * This should be set if the Bitbucket Server instance is hosted on-premises and not reachable by public internet. If this field is left empty,
     * no network peering will occur and calls to the Bitbucket Server instance will be made over the public internet. Must be in the format
     * projects/{project}/global/networks/{network}, where {project} is a project number or id and {network} is the name of a VPC network in the project.
     * 
     */
    public Output<Optional<String>> peeredNetwork() {
        return Codegen.optional(this.peeredNetwork);
    }
    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    @Export(name="project", type=String.class, parameters={})
    private Output<String> project;

    /**
     * @return The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    public Output<String> project() {
        return this.project;
    }
    /**
     * Secret Manager secrets needed by the config.
     * Structure is documented below.
     * 
     */
    @Export(name="secrets", type=BitbucketServerConfigSecrets.class, parameters={})
    private Output<BitbucketServerConfigSecrets> secrets;

    /**
     * @return Secret Manager secrets needed by the config.
     * Structure is documented below.
     * 
     */
    public Output<BitbucketServerConfigSecrets> secrets() {
        return this.secrets;
    }
    /**
     * SSL certificate to use for requests to Bitbucket Server. The format should be PEM format but the extension can be one of .pem, .cer, or .crt.
     * 
     */
    @Export(name="sslCa", type=String.class, parameters={})
    private Output</* @Nullable */ String> sslCa;

    /**
     * @return SSL certificate to use for requests to Bitbucket Server. The format should be PEM format but the extension can be one of .pem, .cer, or .crt.
     * 
     */
    public Output<Optional<String>> sslCa() {
        return Codegen.optional(this.sslCa);
    }
    /**
     * Username of the account Cloud Build will use on Bitbucket Server.
     * 
     */
    @Export(name="username", type=String.class, parameters={})
    private Output<String> username;

    /**
     * @return Username of the account Cloud Build will use on Bitbucket Server.
     * 
     */
    public Output<String> username() {
        return this.username;
    }
    /**
     * Output only. UUID included in webhook requests. The UUID is used to look up the corresponding config.
     * 
     */
    @Export(name="webhookKey", type=String.class, parameters={})
    private Output<String> webhookKey;

    /**
     * @return Output only. UUID included in webhook requests. The UUID is used to look up the corresponding config.
     * 
     */
    public Output<String> webhookKey() {
        return this.webhookKey;
    }

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

    private BitbucketServerConfig(String name, Output<String> id, @Nullable BitbucketServerConfigState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:cloudbuild/bitbucketServerConfig:BitbucketServerConfig", name, state, makeResourceOptions(options, id));
    }

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