mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-16 00:11:26 +00:00
253 lines
9.0 KiB
HTML
253 lines
9.0 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>GHRepositoryBuilder.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">GitHub API for Java</a> > <a href="index.source.html" class="el_package">org.kohsuke.github</a> > <span class="el_source">GHRepositoryBuilder.java</span></div><h1>GHRepositoryBuilder.java</h1><pre class="source lang-java linenums">package org.kohsuke.github;
|
|
|
|
import org.kohsuke.github.GHRepository.Visibility;
|
|
|
|
import java.io.IOException;
|
|
import java.net.URL;
|
|
|
|
import static org.kohsuke.github.internal.Previews.BAPTISTE;
|
|
import static org.kohsuke.github.internal.Previews.NEBULA;
|
|
|
|
abstract class GHRepositoryBuilder<S> extends AbstractBuilder<GHRepository, S> {
|
|
|
|
protected GHRepositoryBuilder(Class<S> intermediateReturnType, GitHub root, GHRepository baseInstance) {
|
|
<span class="fc" id="L14"> super(GHRepository.class, intermediateReturnType, root, baseInstance);</span>
|
|
<span class="fc" id="L15"> }</span>
|
|
|
|
/**
|
|
* Allow or disallow squash-merging pull requests.
|
|
*
|
|
* @param enabled
|
|
* true if enabled
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S allowSquashMerge(boolean enabled) throws IOException {
|
|
<span class="fc" id="L29"> return with("allow_squash_merge", enabled);</span>
|
|
}
|
|
|
|
/**
|
|
* Allow or disallow merging pull requests with a merge commit.
|
|
*
|
|
* @param enabled
|
|
* true if enabled
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S allowMergeCommit(boolean enabled) throws IOException {
|
|
<span class="fc" id="L44"> return with("allow_merge_commit", enabled);</span>
|
|
}
|
|
|
|
/**
|
|
* Allow or disallow rebase-merging pull requests.
|
|
*
|
|
* @param enabled
|
|
* true if enabled
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S allowRebaseMerge(boolean enabled) throws IOException {
|
|
<span class="fc" id="L59"> return with("allow_rebase_merge", enabled);</span>
|
|
}
|
|
|
|
/**
|
|
* After pull requests are merged, you can have head branches deleted automatically.
|
|
*
|
|
* @param enabled
|
|
* true if enabled
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S deleteBranchOnMerge(boolean enabled) throws IOException {
|
|
<span class="fc" id="L74"> return with("delete_branch_on_merge", enabled);</span>
|
|
}
|
|
|
|
/**
|
|
* Default repository branch
|
|
*
|
|
* @param branch
|
|
* branch name
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S defaultBranch(String branch) throws IOException {
|
|
<span class="nc" id="L89"> return with("default_branch", branch);</span>
|
|
}
|
|
|
|
/**
|
|
* Description for repository
|
|
*
|
|
* @param description
|
|
* description of repository
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S description(String description) throws IOException {
|
|
<span class="fc" id="L104"> return with("description", description);</span>
|
|
}
|
|
|
|
/**
|
|
* Homepage for repository
|
|
*
|
|
* @param homepage
|
|
* homepage of repository
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S homepage(URL homepage) throws IOException {
|
|
<span class="nc" id="L119"> return homepage(homepage.toExternalForm());</span>
|
|
}
|
|
|
|
/**
|
|
* Homepage for repository
|
|
*
|
|
* @param homepage
|
|
* homepage of repository
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S homepage(String homepage) throws IOException {
|
|
<span class="fc" id="L134"> return with("homepage", homepage);</span>
|
|
}
|
|
|
|
/**
|
|
* Sets the repository to private
|
|
*
|
|
* @param enabled
|
|
* private if true
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S private_(boolean enabled) throws IOException {
|
|
<span class="fc" id="L149"> return with("private", enabled);</span>
|
|
}
|
|
|
|
/**
|
|
* Sets the repository visibility
|
|
*
|
|
* @param visibility
|
|
* visibility of repository
|
|
* @return a builder to continue with building
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S visibility(final Visibility visibility) throws IOException {
|
|
<span class="nc" id="L162"> requester.withPreview(NEBULA);</span>
|
|
<span class="nc" id="L163"> return with("visibility", visibility);</span>
|
|
}
|
|
|
|
/**
|
|
* Enables issue tracker
|
|
*
|
|
* @param enabled
|
|
* true if enabled
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S issues(boolean enabled) throws IOException {
|
|
<span class="fc" id="L178"> return with("has_issues", enabled);</span>
|
|
}
|
|
|
|
/**
|
|
* Enables projects
|
|
*
|
|
* @param enabled
|
|
* true if enabled
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S projects(boolean enabled) throws IOException {
|
|
<span class="fc" id="L193"> return with("has_projects", enabled);</span>
|
|
}
|
|
|
|
/**
|
|
* Enables wiki
|
|
*
|
|
* @param enabled
|
|
* true if enabled
|
|
* @return a builder to continue with building
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S wiki(boolean enabled) throws IOException {
|
|
<span class="fc" id="L206"> return with("has_wiki", enabled);</span>
|
|
}
|
|
|
|
/**
|
|
* Enables downloads
|
|
*
|
|
* @param enabled
|
|
* true if enabled
|
|
*
|
|
* @return a builder to continue with building
|
|
*
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
public S downloads(boolean enabled) throws IOException {
|
|
<span class="fc" id="L221"> return with("has_downloads", enabled);</span>
|
|
}
|
|
|
|
/**
|
|
* Specifies whether the repository is a template.
|
|
*
|
|
* @param enabled
|
|
* true if enabled
|
|
* @return a builder to continue with building
|
|
* @throws IOException
|
|
* In case of any networking error or error from the server.
|
|
*/
|
|
@Preview(BAPTISTE)
|
|
@Deprecated
|
|
public S isTemplate(boolean enabled) throws IOException {
|
|
<span class="fc" id="L236"> requester.withPreview(BAPTISTE);</span>
|
|
<span class="fc" id="L237"> return with("is_template", enabled);</span>
|
|
}
|
|
|
|
@Override
|
|
public GHRepository done() throws IOException {
|
|
<span class="fc" id="L242"> return super.done().wrap(this.root);</span>
|
|
}
|
|
|
|
S archive() throws IOException {
|
|
<span class="fc" id="L246"> return with("archived", true);</span>
|
|
}
|
|
|
|
S name(String name) throws IOException {
|
|
<span class="fc" id="L250"> return with("name", name);</span>
|
|
}
|
|
}
|
|
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.7.202105040129</span></div></body></html> |