mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-23 15:50:48 +00:00
236 lines
8.4 KiB
HTML
236 lines
8.4 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 java.io.IOException;
|
|
import java.net.URL;
|
|
|
|
import static org.kohsuke.github.internal.Previews.BAPTISTE;
|
|
|
|
abstract class GHRepositoryBuilder<S> extends AbstractBuilder<GHRepository, S> {
|
|
|
|
protected GHRepositoryBuilder(Class<S> intermediateReturnType, GitHub root, GHRepository baseInstance) {
|
|
<span class="fc" id="L11"> super(GHRepository.class, intermediateReturnType, root, baseInstance);</span>
|
|
<span class="fc" id="L12"> }</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="L26"> 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="L41"> 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="L56"> 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="L71"> 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="L86"> 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="L101"> 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="L116"> 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="L131"> 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="L146"> return with("private", enabled);</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="L161"> 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="L176"> 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="L189"> 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="L204"> 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="L219"> requester.withPreview(BAPTISTE);</span>
|
|
<span class="fc" id="L220"> return with("is_template", enabled);</span>
|
|
}
|
|
|
|
@Override
|
|
public GHRepository done() throws IOException {
|
|
<span class="fc" id="L225"> return super.done().wrap(this.root);</span>
|
|
}
|
|
|
|
S archive() throws IOException {
|
|
<span class="fc" id="L229"> return with("archived", true);</span>
|
|
}
|
|
|
|
S name(String name) throws IOException {
|
|
<span class="fc" id="L233"> 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.6.202009150832</span></div></body></html> |