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

com.pulumi.github.inputs.BranchProtectionState Maven / Gradle / Ivy

The 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.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.github.inputs.BranchProtectionRequiredPullRequestReviewArgs;
import com.pulumi.github.inputs.BranchProtectionRequiredStatusCheckArgs;
import com.pulumi.github.inputs.BranchProtectionRestrictPushArgs;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


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

    public static final BranchProtectionState Empty = new BranchProtectionState();

    /**
     * Boolean, setting this to `true` to allow the branch to be deleted.
     * 
     */
    @Import(name="allowsDeletions")
    private @Nullable Output allowsDeletions;

    /**
     * @return Boolean, setting this to `true` to allow the branch to be deleted.
     * 
     */
    public Optional> allowsDeletions() {
        return Optional.ofNullable(this.allowsDeletions);
    }

    /**
     * Boolean, setting this to `true` to allow force pushes on the branch to everyone. Set it to `false` if you specify `force_push_bypassers`.
     * 
     */
    @Import(name="allowsForcePushes")
    private @Nullable Output allowsForcePushes;

    /**
     * @return Boolean, setting this to `true` to allow force pushes on the branch to everyone. Set it to `false` if you specify `force_push_bypassers`.
     * 
     */
    public Optional> allowsForcePushes() {
        return Optional.ofNullable(this.allowsForcePushes);
    }

    /**
     * Boolean, setting this to `true` enforces status checks for repository administrators.
     * 
     */
    @Import(name="enforceAdmins")
    private @Nullable Output enforceAdmins;

    /**
     * @return Boolean, setting this to `true` enforces status checks for repository administrators.
     * 
     */
    public Optional> enforceAdmins() {
        return Optional.ofNullable(this.enforceAdmins);
    }

    /**
     * The list of actor Names/IDs that are allowed to bypass force push restrictions. Actor names must either begin with a "/" for users or the organization name followed by a "/" for teams. If the list is not empty, `allows_force_pushes` should be set to `false`.
     * 
     */
    @Import(name="forcePushBypassers")
    private @Nullable Output> forcePushBypassers;

    /**
     * @return The list of actor Names/IDs that are allowed to bypass force push restrictions. Actor names must either begin with a "/" for users or the organization name followed by a "/" for teams. If the list is not empty, `allows_force_pushes` should be set to `false`.
     * 
     */
    public Optional>> forcePushBypassers() {
        return Optional.ofNullable(this.forcePushBypassers);
    }

    /**
     * Boolean, Setting this to `true` will make the branch read-only and preventing any pushes to it. Defaults to `false`
     * 
     */
    @Import(name="lockBranch")
    private @Nullable Output lockBranch;

    /**
     * @return Boolean, Setting this to `true` will make the branch read-only and preventing any pushes to it. Defaults to `false`
     * 
     */
    public Optional> lockBranch() {
        return Optional.ofNullable(this.lockBranch);
    }

    /**
     * Identifies the protection rule pattern.
     * 
     */
    @Import(name="pattern")
    private @Nullable Output pattern;

    /**
     * @return Identifies the protection rule pattern.
     * 
     */
    public Optional> pattern() {
        return Optional.ofNullable(this.pattern);
    }

    /**
     * The name or node ID of the repository associated with this branch protection rule.
     * 
     */
    @Import(name="repositoryId")
    private @Nullable Output repositoryId;

    /**
     * @return The name or node ID of the repository associated with this branch protection rule.
     * 
     */
    public Optional> repositoryId() {
        return Optional.ofNullable(this.repositoryId);
    }

    /**
     * Boolean, setting this to `true` requires all conversations on code must be resolved before a pull request can be merged.
     * 
     */
    @Import(name="requireConversationResolution")
    private @Nullable Output requireConversationResolution;

    /**
     * @return Boolean, setting this to `true` requires all conversations on code must be resolved before a pull request can be merged.
     * 
     */
    public Optional> requireConversationResolution() {
        return Optional.ofNullable(this.requireConversationResolution);
    }

    /**
     * Boolean, setting this to `true` requires all commits to be signed with GPG.
     * 
     */
    @Import(name="requireSignedCommits")
    private @Nullable Output requireSignedCommits;

    /**
     * @return Boolean, setting this to `true` requires all commits to be signed with GPG.
     * 
     */
    public Optional> requireSignedCommits() {
        return Optional.ofNullable(this.requireSignedCommits);
    }

    /**
     * Boolean, setting this to `true` enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch
     * 
     */
    @Import(name="requiredLinearHistory")
    private @Nullable Output requiredLinearHistory;

    /**
     * @return Boolean, setting this to `true` enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch
     * 
     */
    public Optional> requiredLinearHistory() {
        return Optional.ofNullable(this.requiredLinearHistory);
    }

    /**
     * Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
     * 
     */
    @Import(name="requiredPullRequestReviews")
    private @Nullable Output> requiredPullRequestReviews;

    /**
     * @return Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
     * 
     */
    public Optional>> requiredPullRequestReviews() {
        return Optional.ofNullable(this.requiredPullRequestReviews);
    }

    /**
     * Enforce restrictions for required status checks. See Required Status Checks below for details.
     * 
     */
    @Import(name="requiredStatusChecks")
    private @Nullable Output> requiredStatusChecks;

    /**
     * @return Enforce restrictions for required status checks. See Required Status Checks below for details.
     * 
     */
    public Optional>> requiredStatusChecks() {
        return Optional.ofNullable(this.requiredStatusChecks);
    }

    /**
     * Restrict pushes to matching branches. See Restrict Pushes below for details.
     * 
     */
    @Import(name="restrictPushes")
    private @Nullable Output> restrictPushes;

    /**
     * @return Restrict pushes to matching branches. See Restrict Pushes below for details.
     * 
     */
    public Optional>> restrictPushes() {
        return Optional.ofNullable(this.restrictPushes);
    }

    private BranchProtectionState() {}

    private BranchProtectionState(BranchProtectionState $) {
        this.allowsDeletions = $.allowsDeletions;
        this.allowsForcePushes = $.allowsForcePushes;
        this.enforceAdmins = $.enforceAdmins;
        this.forcePushBypassers = $.forcePushBypassers;
        this.lockBranch = $.lockBranch;
        this.pattern = $.pattern;
        this.repositoryId = $.repositoryId;
        this.requireConversationResolution = $.requireConversationResolution;
        this.requireSignedCommits = $.requireSignedCommits;
        this.requiredLinearHistory = $.requiredLinearHistory;
        this.requiredPullRequestReviews = $.requiredPullRequestReviews;
        this.requiredStatusChecks = $.requiredStatusChecks;
        this.restrictPushes = $.restrictPushes;
    }

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

    public static final class Builder {
        private BranchProtectionState $;

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

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

        /**
         * @param allowsDeletions Boolean, setting this to `true` to allow the branch to be deleted.
         * 
         * @return builder
         * 
         */
        public Builder allowsDeletions(@Nullable Output allowsDeletions) {
            $.allowsDeletions = allowsDeletions;
            return this;
        }

        /**
         * @param allowsDeletions Boolean, setting this to `true` to allow the branch to be deleted.
         * 
         * @return builder
         * 
         */
        public Builder allowsDeletions(Boolean allowsDeletions) {
            return allowsDeletions(Output.of(allowsDeletions));
        }

        /**
         * @param allowsForcePushes Boolean, setting this to `true` to allow force pushes on the branch to everyone. Set it to `false` if you specify `force_push_bypassers`.
         * 
         * @return builder
         * 
         */
        public Builder allowsForcePushes(@Nullable Output allowsForcePushes) {
            $.allowsForcePushes = allowsForcePushes;
            return this;
        }

        /**
         * @param allowsForcePushes Boolean, setting this to `true` to allow force pushes on the branch to everyone. Set it to `false` if you specify `force_push_bypassers`.
         * 
         * @return builder
         * 
         */
        public Builder allowsForcePushes(Boolean allowsForcePushes) {
            return allowsForcePushes(Output.of(allowsForcePushes));
        }

        /**
         * @param enforceAdmins Boolean, setting this to `true` enforces status checks for repository administrators.
         * 
         * @return builder
         * 
         */
        public Builder enforceAdmins(@Nullable Output enforceAdmins) {
            $.enforceAdmins = enforceAdmins;
            return this;
        }

        /**
         * @param enforceAdmins Boolean, setting this to `true` enforces status checks for repository administrators.
         * 
         * @return builder
         * 
         */
        public Builder enforceAdmins(Boolean enforceAdmins) {
            return enforceAdmins(Output.of(enforceAdmins));
        }

        /**
         * @param forcePushBypassers The list of actor Names/IDs that are allowed to bypass force push restrictions. Actor names must either begin with a "/" for users or the organization name followed by a "/" for teams. If the list is not empty, `allows_force_pushes` should be set to `false`.
         * 
         * @return builder
         * 
         */
        public Builder forcePushBypassers(@Nullable Output> forcePushBypassers) {
            $.forcePushBypassers = forcePushBypassers;
            return this;
        }

        /**
         * @param forcePushBypassers The list of actor Names/IDs that are allowed to bypass force push restrictions. Actor names must either begin with a "/" for users or the organization name followed by a "/" for teams. If the list is not empty, `allows_force_pushes` should be set to `false`.
         * 
         * @return builder
         * 
         */
        public Builder forcePushBypassers(List forcePushBypassers) {
            return forcePushBypassers(Output.of(forcePushBypassers));
        }

        /**
         * @param forcePushBypassers The list of actor Names/IDs that are allowed to bypass force push restrictions. Actor names must either begin with a "/" for users or the organization name followed by a "/" for teams. If the list is not empty, `allows_force_pushes` should be set to `false`.
         * 
         * @return builder
         * 
         */
        public Builder forcePushBypassers(String... forcePushBypassers) {
            return forcePushBypassers(List.of(forcePushBypassers));
        }

        /**
         * @param lockBranch Boolean, Setting this to `true` will make the branch read-only and preventing any pushes to it. Defaults to `false`
         * 
         * @return builder
         * 
         */
        public Builder lockBranch(@Nullable Output lockBranch) {
            $.lockBranch = lockBranch;
            return this;
        }

        /**
         * @param lockBranch Boolean, Setting this to `true` will make the branch read-only and preventing any pushes to it. Defaults to `false`
         * 
         * @return builder
         * 
         */
        public Builder lockBranch(Boolean lockBranch) {
            return lockBranch(Output.of(lockBranch));
        }

        /**
         * @param pattern Identifies the protection rule pattern.
         * 
         * @return builder
         * 
         */
        public Builder pattern(@Nullable Output pattern) {
            $.pattern = pattern;
            return this;
        }

        /**
         * @param pattern Identifies the protection rule pattern.
         * 
         * @return builder
         * 
         */
        public Builder pattern(String pattern) {
            return pattern(Output.of(pattern));
        }

        /**
         * @param repositoryId The name or node ID of the repository associated with this branch protection rule.
         * 
         * @return builder
         * 
         */
        public Builder repositoryId(@Nullable Output repositoryId) {
            $.repositoryId = repositoryId;
            return this;
        }

        /**
         * @param repositoryId The name or node ID of the repository associated with this branch protection rule.
         * 
         * @return builder
         * 
         */
        public Builder repositoryId(String repositoryId) {
            return repositoryId(Output.of(repositoryId));
        }

        /**
         * @param requireConversationResolution Boolean, setting this to `true` requires all conversations on code must be resolved before a pull request can be merged.
         * 
         * @return builder
         * 
         */
        public Builder requireConversationResolution(@Nullable Output requireConversationResolution) {
            $.requireConversationResolution = requireConversationResolution;
            return this;
        }

        /**
         * @param requireConversationResolution Boolean, setting this to `true` requires all conversations on code must be resolved before a pull request can be merged.
         * 
         * @return builder
         * 
         */
        public Builder requireConversationResolution(Boolean requireConversationResolution) {
            return requireConversationResolution(Output.of(requireConversationResolution));
        }

        /**
         * @param requireSignedCommits Boolean, setting this to `true` requires all commits to be signed with GPG.
         * 
         * @return builder
         * 
         */
        public Builder requireSignedCommits(@Nullable Output requireSignedCommits) {
            $.requireSignedCommits = requireSignedCommits;
            return this;
        }

        /**
         * @param requireSignedCommits Boolean, setting this to `true` requires all commits to be signed with GPG.
         * 
         * @return builder
         * 
         */
        public Builder requireSignedCommits(Boolean requireSignedCommits) {
            return requireSignedCommits(Output.of(requireSignedCommits));
        }

        /**
         * @param requiredLinearHistory Boolean, setting this to `true` enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch
         * 
         * @return builder
         * 
         */
        public Builder requiredLinearHistory(@Nullable Output requiredLinearHistory) {
            $.requiredLinearHistory = requiredLinearHistory;
            return this;
        }

        /**
         * @param requiredLinearHistory Boolean, setting this to `true` enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch
         * 
         * @return builder
         * 
         */
        public Builder requiredLinearHistory(Boolean requiredLinearHistory) {
            return requiredLinearHistory(Output.of(requiredLinearHistory));
        }

        /**
         * @param requiredPullRequestReviews Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
         * 
         * @return builder
         * 
         */
        public Builder requiredPullRequestReviews(@Nullable Output> requiredPullRequestReviews) {
            $.requiredPullRequestReviews = requiredPullRequestReviews;
            return this;
        }

        /**
         * @param requiredPullRequestReviews Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
         * 
         * @return builder
         * 
         */
        public Builder requiredPullRequestReviews(List requiredPullRequestReviews) {
            return requiredPullRequestReviews(Output.of(requiredPullRequestReviews));
        }

        /**
         * @param requiredPullRequestReviews Enforce restrictions for pull request reviews. See Required Pull Request Reviews below for details.
         * 
         * @return builder
         * 
         */
        public Builder requiredPullRequestReviews(BranchProtectionRequiredPullRequestReviewArgs... requiredPullRequestReviews) {
            return requiredPullRequestReviews(List.of(requiredPullRequestReviews));
        }

        /**
         * @param requiredStatusChecks Enforce restrictions for required status checks. See Required Status Checks below for details.
         * 
         * @return builder
         * 
         */
        public Builder requiredStatusChecks(@Nullable Output> requiredStatusChecks) {
            $.requiredStatusChecks = requiredStatusChecks;
            return this;
        }

        /**
         * @param requiredStatusChecks Enforce restrictions for required status checks. See Required Status Checks below for details.
         * 
         * @return builder
         * 
         */
        public Builder requiredStatusChecks(List requiredStatusChecks) {
            return requiredStatusChecks(Output.of(requiredStatusChecks));
        }

        /**
         * @param requiredStatusChecks Enforce restrictions for required status checks. See Required Status Checks below for details.
         * 
         * @return builder
         * 
         */
        public Builder requiredStatusChecks(BranchProtectionRequiredStatusCheckArgs... requiredStatusChecks) {
            return requiredStatusChecks(List.of(requiredStatusChecks));
        }

        /**
         * @param restrictPushes Restrict pushes to matching branches. See Restrict Pushes below for details.
         * 
         * @return builder
         * 
         */
        public Builder restrictPushes(@Nullable Output> restrictPushes) {
            $.restrictPushes = restrictPushes;
            return this;
        }

        /**
         * @param restrictPushes Restrict pushes to matching branches. See Restrict Pushes below for details.
         * 
         * @return builder
         * 
         */
        public Builder restrictPushes(List restrictPushes) {
            return restrictPushes(Output.of(restrictPushes));
        }

        /**
         * @param restrictPushes Restrict pushes to matching branches. See Restrict Pushes below for details.
         * 
         * @return builder
         * 
         */
        public Builder restrictPushes(BranchProtectionRestrictPushArgs... restrictPushes) {
            return restrictPushes(List.of(restrictPushes));
        }

        public BranchProtectionState build() {
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy