Files
github-api/jacoco/org.kohsuke.github/GHDeploymentStatusBuilder.java.html
2021-06-02 11:09:28 -07:00

159 lines
6.7 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>GHDeploymentStatusBuilder.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> &gt; <a href="index.source.html" class="el_package">org.kohsuke.github</a> &gt; <span class="el_source">GHDeploymentStatusBuilder.java</span></div><h1>GHDeploymentStatusBuilder.java</h1><pre class="source lang-java linenums">package org.kohsuke.github;
import org.kohsuke.github.internal.Previews;
import java.io.IOException;
/**
* Creates a new deployment status.
*
* @see GHDeployment#createStatus(GHDeploymentState) GHDeployment#createStatus(GHDeploymentState)
*/
public class GHDeploymentStatusBuilder {
private final Requester builder;
private GHRepository repo;
private long deploymentId;
/**
* Instantiates a new Gh deployment status builder.
*
* @param repo
* the repo
* @param deploymentId
* the deployment id
* @param state
* the state
*
* @deprecated Use {@link GHDeployment#createStatus(GHDeploymentState)}
*/
@Deprecated
public GHDeploymentStatusBuilder(GHRepository repo, int deploymentId, GHDeploymentState state) {
<span class="nc" id="L31"> this(repo, (long) deploymentId, state);</span>
<span class="nc" id="L32"> }</span>
<span class="fc" id="L34"> GHDeploymentStatusBuilder(GHRepository repo, long deploymentId, GHDeploymentState state) {</span>
<span class="fc" id="L35"> this.repo = repo;</span>
<span class="fc" id="L36"> this.deploymentId = deploymentId;</span>
<span class="fc" id="L37"> this.builder = repo.root.createRequest()</span>
<span class="fc" id="L38"> .withPreview(Previews.ANT_MAN)</span>
<span class="fc" id="L39"> .withPreview(Previews.FLASH)</span>
<span class="fc" id="L40"> .method(&quot;POST&quot;);</span>
<span class="fc" id="L42"> this.builder.with(&quot;state&quot;, state);</span>
<span class="fc" id="L43"> }</span>
/**
* Add an inactive status to all prior non-transient, non-production environment deployments with the same
* repository and environment name as the created status's deployment.
*
* @deprecated until preview feature has graduated to stable
*
* @param autoInactive
* Add inactive status flag
*
* @return the gh deployment status builder
*/
@Deprecated
@Preview({ Previews.ANT_MAN, Previews.FLASH })
public GHDeploymentStatusBuilder autoInactive(boolean autoInactive) {
<span class="nc" id="L59"> this.builder.with(&quot;auto_inactive&quot;, autoInactive);</span>
<span class="nc" id="L60"> return this;</span>
}
/**
* Description gh deployment status builder.
*
* @param description
* the description
*
* @return the gh deployment status builder
*/
public GHDeploymentStatusBuilder description(String description) {
<span class="fc" id="L72"> this.builder.with(&quot;description&quot;, description);</span>
<span class="fc" id="L73"> return this;</span>
}
/**
* Name for the target deployment environment, which can be changed when setting a deploy status.
*
* @deprecated until preview feature has graduated to stable
*
* @param environment
* the environment name
*
* @return the gh deployment status builder
*/
@Deprecated
@Preview(Previews.FLASH)
public GHDeploymentStatusBuilder environment(String environment) {
<span class="fc" id="L89"> this.builder.with(&quot;environment&quot;, environment);</span>
<span class="fc" id="L90"> return this;</span>
}
/**
* The URL for accessing the environment
*
* @deprecated until preview feature has graduated to stable
*
* @param environmentUrl
* the environment url
*
* @return the gh deployment status builder
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public GHDeploymentStatusBuilder environmentUrl(String environmentUrl) {
<span class="fc" id="L106"> this.builder.with(&quot;environment_url&quot;, environmentUrl);</span>
<span class="fc" id="L107"> return this;</span>
}
/**
* The full URL of the deployment's output.
* &lt;p&gt;
* This method replaces {@link #targetUrl(String) targetUrl}.
*
* @deprecated until preview feature has graduated to stable
*
* @param logUrl
* the deployment output url
*
* @return the gh deployment status builder
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public GHDeploymentStatusBuilder logUrl(String logUrl) {
<span class="fc" id="L125"> this.builder.with(&quot;log_url&quot;, logUrl);</span>
<span class="fc" id="L126"> return this;</span>
}
/**
* Target url gh deployment status builder.
*
* @deprecated Target url is deprecated in favor of {@link #logUrl(String) logUrl}
*
* @param targetUrl
* the target url
*
* @return the gh deployment status builder
*/
@Deprecated
public GHDeploymentStatusBuilder targetUrl(String targetUrl) {
<span class="fc" id="L141"> this.builder.with(&quot;target_url&quot;, targetUrl);</span>
<span class="fc" id="L142"> return this;</span>
}
/**
* Create gh deployment status.
*
* @return the gh deployment status
*
* @throws IOException
* the io exception
*/
public GHDeploymentStatus create() throws IOException {
<span class="fc" id="L154"> return builder.withUrlPath(repo.getApiTailUrl(&quot;deployments/&quot; + deploymentId + &quot;/statuses&quot;))</span>
<span class="fc" id="L155"> .fetch(GHDeploymentStatus.class)</span>
<span class="fc" id="L156"> .wrap(repo);</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>