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

import com.pulumi.core.annotations.CustomType;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class TriggerSourceToBuild {
    /**
     * @return The full resource name of the bitbucket server config.
     * Format: projects/{project}/locations/{location}/bitbucketServerConfigs/{id}.
     * 
     */
    private @Nullable String bitbucketServerConfig;
    /**
     * @return The full resource name of the github enterprise config.
     * Format: projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}. projects/{project}/githubEnterpriseConfigs/{id}.
     * 
     */
    private @Nullable String githubEnterpriseConfig;
    /**
     * @return The branch or tag to use. Must start with &#34;refs/&#34; (required).
     * 
     */
    private String ref;
    /**
     * @return The type of the repo, since it may not be explicit from the repo field (e.g from a URL).
     * Values can be UNKNOWN, CLOUD_SOURCE_REPOSITORIES, GITHUB, BITBUCKET_SERVER
     * Possible values are: `UNKNOWN`, `CLOUD_SOURCE_REPOSITORIES`, `GITHUB`, `BITBUCKET_SERVER`.
     * 
     */
    private String repoType;
    /**
     * @return The qualified resource name of the Repo API repository.
     * Either uri or repository can be specified and is required.
     * 
     */
    private @Nullable String repository;
    /**
     * @return The URI of the repo.
     * 
     */
    private @Nullable String uri;

    private TriggerSourceToBuild() {}
    /**
     * @return The full resource name of the bitbucket server config.
     * Format: projects/{project}/locations/{location}/bitbucketServerConfigs/{id}.
     * 
     */
    public Optional<String> bitbucketServerConfig() {
        return Optional.ofNullable(this.bitbucketServerConfig);
    }
    /**
     * @return The full resource name of the github enterprise config.
     * Format: projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}. projects/{project}/githubEnterpriseConfigs/{id}.
     * 
     */
    public Optional<String> githubEnterpriseConfig() {
        return Optional.ofNullable(this.githubEnterpriseConfig);
    }
    /**
     * @return The branch or tag to use. Must start with &#34;refs/&#34; (required).
     * 
     */
    public String ref() {
        return this.ref;
    }
    /**
     * @return The type of the repo, since it may not be explicit from the repo field (e.g from a URL).
     * Values can be UNKNOWN, CLOUD_SOURCE_REPOSITORIES, GITHUB, BITBUCKET_SERVER
     * Possible values are: `UNKNOWN`, `CLOUD_SOURCE_REPOSITORIES`, `GITHUB`, `BITBUCKET_SERVER`.
     * 
     */
    public String repoType() {
        return this.repoType;
    }
    /**
     * @return The qualified resource name of the Repo API repository.
     * Either uri or repository can be specified and is required.
     * 
     */
    public Optional<String> repository() {
        return Optional.ofNullable(this.repository);
    }
    /**
     * @return The URI of the repo.
     * 
     */
    public Optional<String> uri() {
        return Optional.ofNullable(this.uri);
    }

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

    public static Builder builder(TriggerSourceToBuild defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String bitbucketServerConfig;
        private @Nullable String githubEnterpriseConfig;
        private String ref;
        private String repoType;
        private @Nullable String repository;
        private @Nullable String uri;
        public Builder() {}
        public Builder(TriggerSourceToBuild defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.bitbucketServerConfig = defaults.bitbucketServerConfig;
    	      this.githubEnterpriseConfig = defaults.githubEnterpriseConfig;
    	      this.ref = defaults.ref;
    	      this.repoType = defaults.repoType;
    	      this.repository = defaults.repository;
    	      this.uri = defaults.uri;
        }

        @CustomType.Setter
        public Builder bitbucketServerConfig(@Nullable String bitbucketServerConfig) {
            this.bitbucketServerConfig = bitbucketServerConfig;
            return this;
        }
        @CustomType.Setter
        public Builder githubEnterpriseConfig(@Nullable String githubEnterpriseConfig) {
            this.githubEnterpriseConfig = githubEnterpriseConfig;
            return this;
        }
        @CustomType.Setter
        public Builder ref(String ref) {
            this.ref = Objects.requireNonNull(ref);
            return this;
        }
        @CustomType.Setter
        public Builder repoType(String repoType) {
            this.repoType = Objects.requireNonNull(repoType);
            return this;
        }
        @CustomType.Setter
        public Builder repository(@Nullable String repository) {
            this.repository = repository;
            return this;
        }
        @CustomType.Setter
        public Builder uri(@Nullable String uri) {
            this.uri = uri;
            return this;
        }
        public TriggerSourceToBuild build() {
            final var o = new TriggerSourceToBuild();
            o.bitbucketServerConfig = bitbucketServerConfig;
            o.githubEnterpriseConfig = githubEnterpriseConfig;
            o.ref = ref;
            o.repoType = repoType;
            o.repository = repository;
            o.uri = uri;
            return o;
        }
    }
}
