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

com.pulumi.github.outputs.BranchProtectionV3RequiredPullRequestReviews 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.outputs;

import com.pulumi.core.annotations.CustomType;
import com.pulumi.github.outputs.BranchProtectionV3RequiredPullRequestReviewsBypassPullRequestAllowances;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class BranchProtectionV3RequiredPullRequestReviews {
    /**
     * @return Allow specific users, teams, or apps to bypass pull request requirements. See Bypass Pull Request Allowances below for details.
     * 
     */
    private @Nullable BranchProtectionV3RequiredPullRequestReviewsBypassPullRequestAllowances bypassPullRequestAllowances;
    /**
     * @return Dismiss approved reviews automatically when a new commit is pushed. Defaults to `false`.
     * 
     */
    private @Nullable Boolean dismissStaleReviews;
    /**
     * @return The list of app slugs with dismissal access.
     * 
     */
    private @Nullable List dismissalApps;
    /**
     * @return The list of team slugs with dismissal access.
     * Always use `slug` of the team, **not** its name. Each team already **has** to have access to the repository.
     * 
     */
    private @Nullable List dismissalTeams;
    /**
     * @return The list of user logins with dismissal access
     * 
     */
    private @Nullable List dismissalUsers;
    /**
     * @deprecated
     * Use enforce_admins instead
     * 
     */
    @Deprecated /* Use enforce_admins instead */
    private @Nullable Boolean includeAdmins;
    /**
     * @return Require an approved review in pull requests including files with a designated code owner. Defaults to `false`.
     * 
     */
    private @Nullable Boolean requireCodeOwnerReviews;
    /**
     * @return Require that the most recent push must be approved by someone other than the last pusher.  Defaults to `false`
     * 
     */
    private @Nullable Boolean requireLastPushApproval;
    /**
     * @return Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information.
     * 
     */
    private @Nullable Integer requiredApprovingReviewCount;

    private BranchProtectionV3RequiredPullRequestReviews() {}
    /**
     * @return Allow specific users, teams, or apps to bypass pull request requirements. See Bypass Pull Request Allowances below for details.
     * 
     */
    public Optional bypassPullRequestAllowances() {
        return Optional.ofNullable(this.bypassPullRequestAllowances);
    }
    /**
     * @return Dismiss approved reviews automatically when a new commit is pushed. Defaults to `false`.
     * 
     */
    public Optional dismissStaleReviews() {
        return Optional.ofNullable(this.dismissStaleReviews);
    }
    /**
     * @return The list of app slugs with dismissal access.
     * 
     */
    public List dismissalApps() {
        return this.dismissalApps == null ? List.of() : this.dismissalApps;
    }
    /**
     * @return The list of team slugs with dismissal access.
     * Always use `slug` of the team, **not** its name. Each team already **has** to have access to the repository.
     * 
     */
    public List dismissalTeams() {
        return this.dismissalTeams == null ? List.of() : this.dismissalTeams;
    }
    /**
     * @return The list of user logins with dismissal access
     * 
     */
    public List dismissalUsers() {
        return this.dismissalUsers == null ? List.of() : this.dismissalUsers;
    }
    /**
     * @deprecated
     * Use enforce_admins instead
     * 
     */
    @Deprecated /* Use enforce_admins instead */
    public Optional includeAdmins() {
        return Optional.ofNullable(this.includeAdmins);
    }
    /**
     * @return Require an approved review in pull requests including files with a designated code owner. Defaults to `false`.
     * 
     */
    public Optional requireCodeOwnerReviews() {
        return Optional.ofNullable(this.requireCodeOwnerReviews);
    }
    /**
     * @return Require that the most recent push must be approved by someone other than the last pusher.  Defaults to `false`
     * 
     */
    public Optional requireLastPushApproval() {
        return Optional.ofNullable(this.requireLastPushApproval);
    }
    /**
     * @return Require x number of approvals to satisfy branch protection requirements. If this is specified it must be a number between 0-6. This requirement matches GitHub's API, see the upstream [documentation](https://developer.github.com/v3/repos/branches/#parameters-1) for more information.
     * 
     */
    public Optional requiredApprovingReviewCount() {
        return Optional.ofNullable(this.requiredApprovingReviewCount);
    }

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

    public static Builder builder(BranchProtectionV3RequiredPullRequestReviews defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable BranchProtectionV3RequiredPullRequestReviewsBypassPullRequestAllowances bypassPullRequestAllowances;
        private @Nullable Boolean dismissStaleReviews;
        private @Nullable List dismissalApps;
        private @Nullable List dismissalTeams;
        private @Nullable List dismissalUsers;
        private @Nullable Boolean includeAdmins;
        private @Nullable Boolean requireCodeOwnerReviews;
        private @Nullable Boolean requireLastPushApproval;
        private @Nullable Integer requiredApprovingReviewCount;
        public Builder() {}
        public Builder(BranchProtectionV3RequiredPullRequestReviews defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.bypassPullRequestAllowances = defaults.bypassPullRequestAllowances;
    	      this.dismissStaleReviews = defaults.dismissStaleReviews;
    	      this.dismissalApps = defaults.dismissalApps;
    	      this.dismissalTeams = defaults.dismissalTeams;
    	      this.dismissalUsers = defaults.dismissalUsers;
    	      this.includeAdmins = defaults.includeAdmins;
    	      this.requireCodeOwnerReviews = defaults.requireCodeOwnerReviews;
    	      this.requireLastPushApproval = defaults.requireLastPushApproval;
    	      this.requiredApprovingReviewCount = defaults.requiredApprovingReviewCount;
        }

        @CustomType.Setter
        public Builder bypassPullRequestAllowances(@Nullable BranchProtectionV3RequiredPullRequestReviewsBypassPullRequestAllowances bypassPullRequestAllowances) {

            this.bypassPullRequestAllowances = bypassPullRequestAllowances;
            return this;
        }
        @CustomType.Setter
        public Builder dismissStaleReviews(@Nullable Boolean dismissStaleReviews) {

            this.dismissStaleReviews = dismissStaleReviews;
            return this;
        }
        @CustomType.Setter
        public Builder dismissalApps(@Nullable List dismissalApps) {

            this.dismissalApps = dismissalApps;
            return this;
        }
        public Builder dismissalApps(String... dismissalApps) {
            return dismissalApps(List.of(dismissalApps));
        }
        @CustomType.Setter
        public Builder dismissalTeams(@Nullable List dismissalTeams) {

            this.dismissalTeams = dismissalTeams;
            return this;
        }
        public Builder dismissalTeams(String... dismissalTeams) {
            return dismissalTeams(List.of(dismissalTeams));
        }
        @CustomType.Setter
        public Builder dismissalUsers(@Nullable List dismissalUsers) {

            this.dismissalUsers = dismissalUsers;
            return this;
        }
        public Builder dismissalUsers(String... dismissalUsers) {
            return dismissalUsers(List.of(dismissalUsers));
        }
        @CustomType.Setter
        public Builder includeAdmins(@Nullable Boolean includeAdmins) {

            this.includeAdmins = includeAdmins;
            return this;
        }
        @CustomType.Setter
        public Builder requireCodeOwnerReviews(@Nullable Boolean requireCodeOwnerReviews) {

            this.requireCodeOwnerReviews = requireCodeOwnerReviews;
            return this;
        }
        @CustomType.Setter
        public Builder requireLastPushApproval(@Nullable Boolean requireLastPushApproval) {

            this.requireLastPushApproval = requireLastPushApproval;
            return this;
        }
        @CustomType.Setter
        public Builder requiredApprovingReviewCount(@Nullable Integer requiredApprovingReviewCount) {

            this.requiredApprovingReviewCount = requiredApprovingReviewCount;
            return this;
        }
        public BranchProtectionV3RequiredPullRequestReviews build() {
            final var _resultValue = new BranchProtectionV3RequiredPullRequestReviews();
            _resultValue.bypassPullRequestAllowances = bypassPullRequestAllowances;
            _resultValue.dismissStaleReviews = dismissStaleReviews;
            _resultValue.dismissalApps = dismissalApps;
            _resultValue.dismissalTeams = dismissalTeams;
            _resultValue.dismissalUsers = dismissalUsers;
            _resultValue.includeAdmins = includeAdmins;
            _resultValue.requireCodeOwnerReviews = requireCodeOwnerReviews;
            _resultValue.requireLastPushApproval = requireLastPushApproval;
            _resultValue.requiredApprovingReviewCount = requiredApprovingReviewCount;
            return _resultValue;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy