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

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.gcp.cloudbuild.inputs.TriggerBitbucketServerTriggerConfigPullRequestArgs;
import com.pulumi.gcp.cloudbuild.inputs.TriggerBitbucketServerTriggerConfigPushArgs;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class TriggerBitbucketServerTriggerConfigArgs extends com.pulumi.resources.ResourceArgs {

    public static final TriggerBitbucketServerTriggerConfigArgs Empty = new TriggerBitbucketServerTriggerConfigArgs();

    /**
     * The Bitbucket server config resource that this trigger config maps to.
     * 
     */
    @Import(name="bitbucketServerConfigResource", required=true)
    private Output<String> bitbucketServerConfigResource;

    /**
     * @return The Bitbucket server config resource that this trigger config maps to.
     * 
     */
    public Output<String> bitbucketServerConfigResource() {
        return this.bitbucketServerConfigResource;
    }

    /**
     * Key of the project that the repo is in. For example: The key for https://mybitbucket.server/projects/TEST/repos/test-repo is &#34;TEST&#34;.
     * 
     */
    @Import(name="projectKey", required=true)
    private Output<String> projectKey;

    /**
     * @return Key of the project that the repo is in. For example: The key for https://mybitbucket.server/projects/TEST/repos/test-repo is &#34;TEST&#34;.
     * 
     */
    public Output<String> projectKey() {
        return this.projectKey;
    }

    /**
     * Filter to match changes in pull requests.
     * Structure is documented below.
     * 
     */
    @Import(name="pullRequest")
    private @Nullable Output<TriggerBitbucketServerTriggerConfigPullRequestArgs> pullRequest;

    /**
     * @return Filter to match changes in pull requests.
     * Structure is documented below.
     * 
     */
    public Optional<Output<TriggerBitbucketServerTriggerConfigPullRequestArgs>> pullRequest() {
        return Optional.ofNullable(this.pullRequest);
    }

    /**
     * Filter to match changes in refs like branches, tags.
     * Structure is documented below.
     * 
     */
    @Import(name="push")
    private @Nullable Output<TriggerBitbucketServerTriggerConfigPushArgs> push;

    /**
     * @return Filter to match changes in refs like branches, tags.
     * Structure is documented below.
     * 
     */
    public Optional<Output<TriggerBitbucketServerTriggerConfigPushArgs>> push() {
        return Optional.ofNullable(this.push);
    }

    /**
     * Slug of the repository. A repository slug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL.
     * For example, if the repository name is &#39;test repo&#39;, in the URL it would become &#39;test-repo&#39; as in https://mybitbucket.server/projects/TEST/repos/test-repo.
     * 
     */
    @Import(name="repoSlug", required=true)
    private Output<String> repoSlug;

    /**
     * @return Slug of the repository. A repository slug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL.
     * For example, if the repository name is &#39;test repo&#39;, in the URL it would become &#39;test-repo&#39; as in https://mybitbucket.server/projects/TEST/repos/test-repo.
     * 
     */
    public Output<String> repoSlug() {
        return this.repoSlug;
    }

    private TriggerBitbucketServerTriggerConfigArgs() {}

    private TriggerBitbucketServerTriggerConfigArgs(TriggerBitbucketServerTriggerConfigArgs $) {
        this.bitbucketServerConfigResource = $.bitbucketServerConfigResource;
        this.projectKey = $.projectKey;
        this.pullRequest = $.pullRequest;
        this.push = $.push;
        this.repoSlug = $.repoSlug;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(TriggerBitbucketServerTriggerConfigArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private TriggerBitbucketServerTriggerConfigArgs $;

        public Builder() {
            $ = new TriggerBitbucketServerTriggerConfigArgs();
        }

        public Builder(TriggerBitbucketServerTriggerConfigArgs defaults) {
            $ = new TriggerBitbucketServerTriggerConfigArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param bitbucketServerConfigResource The Bitbucket server config resource that this trigger config maps to.
         * 
         * @return builder
         * 
         */
        public Builder bitbucketServerConfigResource(Output<String> bitbucketServerConfigResource) {
            $.bitbucketServerConfigResource = bitbucketServerConfigResource;
            return this;
        }

        /**
         * @param bitbucketServerConfigResource The Bitbucket server config resource that this trigger config maps to.
         * 
         * @return builder
         * 
         */
        public Builder bitbucketServerConfigResource(String bitbucketServerConfigResource) {
            return bitbucketServerConfigResource(Output.of(bitbucketServerConfigResource));
        }

        /**
         * @param projectKey Key of the project that the repo is in. For example: The key for https://mybitbucket.server/projects/TEST/repos/test-repo is &#34;TEST&#34;.
         * 
         * @return builder
         * 
         */
        public Builder projectKey(Output<String> projectKey) {
            $.projectKey = projectKey;
            return this;
        }

        /**
         * @param projectKey Key of the project that the repo is in. For example: The key for https://mybitbucket.server/projects/TEST/repos/test-repo is &#34;TEST&#34;.
         * 
         * @return builder
         * 
         */
        public Builder projectKey(String projectKey) {
            return projectKey(Output.of(projectKey));
        }

        /**
         * @param pullRequest Filter to match changes in pull requests.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder pullRequest(@Nullable Output<TriggerBitbucketServerTriggerConfigPullRequestArgs> pullRequest) {
            $.pullRequest = pullRequest;
            return this;
        }

        /**
         * @param pullRequest Filter to match changes in pull requests.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder pullRequest(TriggerBitbucketServerTriggerConfigPullRequestArgs pullRequest) {
            return pullRequest(Output.of(pullRequest));
        }

        /**
         * @param push Filter to match changes in refs like branches, tags.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder push(@Nullable Output<TriggerBitbucketServerTriggerConfigPushArgs> push) {
            $.push = push;
            return this;
        }

        /**
         * @param push Filter to match changes in refs like branches, tags.
         * Structure is documented below.
         * 
         * @return builder
         * 
         */
        public Builder push(TriggerBitbucketServerTriggerConfigPushArgs push) {
            return push(Output.of(push));
        }

        /**
         * @param repoSlug Slug of the repository. A repository slug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL.
         * For example, if the repository name is &#39;test repo&#39;, in the URL it would become &#39;test-repo&#39; as in https://mybitbucket.server/projects/TEST/repos/test-repo.
         * 
         * @return builder
         * 
         */
        public Builder repoSlug(Output<String> repoSlug) {
            $.repoSlug = repoSlug;
            return this;
        }

        /**
         * @param repoSlug Slug of the repository. A repository slug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL.
         * For example, if the repository name is &#39;test repo&#39;, in the URL it would become &#39;test-repo&#39; as in https://mybitbucket.server/projects/TEST/repos/test-repo.
         * 
         * @return builder
         * 
         */
        public Builder repoSlug(String repoSlug) {
            return repoSlug(Output.of(repoSlug));
        }

        public TriggerBitbucketServerTriggerConfigArgs build() {
            $.bitbucketServerConfigResource = Objects.requireNonNull($.bitbucketServerConfigResource, "expected parameter 'bitbucketServerConfigResource' to be non-null");
            $.projectKey = Objects.requireNonNull($.projectKey, "expected parameter 'projectKey' to be non-null");
            $.repoSlug = Objects.requireNonNull($.repoSlug, "expected parameter 'repoSlug' to be non-null");
            return $;
        }
    }

}
