public PushRules updatePushRules(Object projectIdOrPath, PushRules pushRule) throws GitLabApiException {
        GitLabApiForm formData = new GitLabApiForm()
            .withParam("deny_delete_tag", pushRule.getDenyDeleteTag())
            .withParam("member_check", pushRule.getMemberCheck())
            .withParam("prevent_secrets", pushRule.getPreventSecrets())
            .withParam("commit_message_regex", pushRule.getCommitMessageRegex())
            .withParam("branch_name_regex", pushRule.getBranchNameRegex())
            .withParam("author_email_regex", pushRule.getAuthorEmailRegex())
            .withParam("file_name_regex", pushRule.getFileNameRegex())
            .withParam("max_file_size", pushRule.getMaxFileSize());

        final Response response = putWithFormData(Response.Status.OK, formData, "projects", getProjectIdOrPath(projectIdOrPath), "push_rule");
        return (response.readEntity(PushRules.class));
    }
public PushRules updatePushRules ( Object projectIdOrPath , PushRules pushRule ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "deny_delete_tag" , pushRule . getDenyDeleteTag ( ) ) . withParam ( "member_check" , pushRule . getMemberCheck ( ) ) . withParam ( "prevent_secrets" , pushRule . getPreventSecrets ( ) ) . withParam ( "commit_message_regex" , pushRule . getCommitMessageRegex ( ) ) . withParam ( "branch_name_regex" , pushRule . getBranchNameRegex ( ) ) . withParam ( "author_email_regex" , pushRule . getAuthorEmailRegex ( ) ) . withParam ( "file_name_regex" , pushRule . getFileNameRegex ( ) ) . withParam ( "max_file_size" , pushRule . getMaxFileSize ( ) ) ; final Response response = putWithFormData ( Response . Status . OK , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "push_rule" ) ; return ( response . readEntity ( PushRules . class ) ) ; }
Updates a push rule for the specified project.

<pre><code>PUT /projects/:id/push_rule/:push_rule_id</code></pre>

The following properties on the PushRules instance are utilized when updating the push rule:

<code>
denyDeleteTag (optional) - Deny deleting a tag
memberCheck (optional) - Restrict commits by author (email) to existing GitLab users
preventSecrets (optional) - GitLab will reject any files that are likely to contain secrets
commitMessageRegex (optional) - All commit messages must match this, e.g. Fixed \d+\..*
branchNameRegex (optional) - All branch names must match this, e.g. `(feature
authorEmailRegex (optional) - All commit author emails must match this, e.g. @my-company.com$
fileNameRegex (optional) - All committed filenames must not match this, e.g. `(jar
maxFileSize (optional) - Maximum file size (MB
</code>

@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param pushRule the PushRules instance containing the push rule configuration to update
@return a PushRules instance with the newly created push rule info
@throws GitLabApiException if any exception occurs