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

207 lines
7.1 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>GHDeployment.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">GHDeployment.java</span></div><h1>GHDeployment.java</h1><pre class="source lang-java linenums">package org.kohsuke.github;
import org.kohsuke.github.internal.Previews;
import java.io.IOException;
import java.net.URL;
import java.util.Map;
/**
* Represents a deployment
*
* @see &lt;a href=&quot;https://developer.github.com/v3/repos/deployments/&quot;&gt;documentation&lt;/a&gt;
* @see GHRepository#listDeployments(String, String, String, String) GHRepository#listDeployments(String, String,
* String, String)
* @see GHRepository#getDeployment(long) GHRepository#getDeployment(long)
*/
<span class="fc" id="L17">public class GHDeployment extends GHObject {</span>
private GHRepository owner;
protected String sha;
protected String ref;
protected String task;
protected Object payload;
protected String environment;
protected String description;
protected String statuses_url;
protected String repository_url;
protected GHUser creator;
protected String original_environment;
protected boolean transient_environment;
protected boolean production_environment;
GHDeployment wrap(GHRepository owner) {
<span class="fc" id="L33"> this.owner = owner;</span>
<span class="fc" id="L34"> this.root = owner.root;</span>
<span class="pc bpc" id="L35" title="1 of 2 branches missed."> if (creator != null)</span>
<span class="fc" id="L36"> creator.wrapUp(root);</span>
<span class="fc" id="L37"> return this;</span>
}
/**
* Gets statuses url.
*
* @return the statuses url
*/
public URL getStatusesUrl() {
<span class="nc" id="L46"> return GitHubClient.parseURL(statuses_url);</span>
}
/**
* Gets repository url.
*
* @return the repository url
*/
public URL getRepositoryUrl() {
<span class="nc" id="L55"> return GitHubClient.parseURL(repository_url);</span>
}
/**
* Gets task.
*
* @return the task
*/
public String getTask() {
<span class="fc" id="L64"> return task;</span>
}
/**
* Gets payload. &lt;b&gt;NOTE:&lt;/b&gt; only use this method if you can guarantee the payload will be a simple string,
* otherwise use {@link #getPayloadObject()}.
*
* @return the payload
*/
public String getPayload() {
<span class="fc" id="L74"> return (String) payload;</span>
}
/**
* Gets payload. &lt;b&gt;NOTE:&lt;/b&gt; only use this method if you can guarantee the payload will be a JSON object (Map),
* otherwise use {@link #getPayloadObject()}.
*
* @return the payload
*/
public Map&lt;String, Object&gt; getPayloadMap() {
<span class="fc" id="L84"> return (Map&lt;String, Object&gt;) payload;</span>
}
/**
* Gets payload without assuming its type. It could be a String or a Map.
*
* @return the payload
*/
public Object getPayloadObject() {
<span class="fc" id="L93"> return payload;</span>
}
/**
* The environment defined when the deployment was first created.
*
* @deprecated until preview feature has graduated to stable
*
* @return the original deployment environment
*/
@Deprecated
@Preview(Previews.FLASH)
public String getOriginalEnvironment() {
<span class="fc" id="L106"> return original_environment;</span>
}
/**
* Gets environment.
*
* @return the environment
*/
public String getEnvironment() {
<span class="fc" id="L115"> return environment;</span>
}
/**
* Specifies if the given environment is specific to the deployment and will no longer exist at some point in the
* future.
*
* @deprecated until preview feature has graduated to stable
*
* @return the environment is transient
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public boolean isTransientEnvironment() {
<span class="fc" id="L129"> return transient_environment;</span>
}
/**
* Specifies if the given environment is one that end-users directly interact with.
*
* @deprecated until preview feature has graduated to stable
*
* @return the environment is used by end-users directly
*/
@Deprecated
@Preview(Previews.ANT_MAN)
public boolean isProductionEnvironment() {
<span class="fc" id="L142"> return production_environment;</span>
}
/**
* Gets creator.
*
* @return the creator
* @throws IOException
* the io exception
*/
public GHUser getCreator() throws IOException {
<span class="fc" id="L153"> return root.intern(creator);</span>
}
/**
* Gets ref.
*
* @return the ref
*/
public String getRef() {
<span class="fc" id="L162"> return ref;</span>
}
/**
* Gets sha.
*
* @return the sha
*/
public String getSha() {
<span class="fc" id="L171"> return sha;</span>
}
/**
* @deprecated This object has no HTML URL.
*/
@Override
public URL getHtmlUrl() {
<span class="nc" id="L179"> return null;</span>
}
/**
* Create status gh deployment status builder.
*
* @param state
* the state
* @return the gh deployment status builder
*/
public GHDeploymentStatusBuilder createStatus(GHDeploymentState state) {
<span class="fc" id="L190"> return new GHDeploymentStatusBuilder(owner, getId(), state);</span>
}
/**
* List statuses paged iterable.
*
* @return the paged iterable
*/
public PagedIterable&lt;GHDeploymentStatus&gt; listStatuses() {
<span class="fc" id="L199"> return root.createRequest()</span>
<span class="fc" id="L200"> .withUrlPath(statuses_url)</span>
<span class="fc" id="L201"> .withPreview(Previews.ANT_MAN)</span>
<span class="fc" id="L202"> .withPreview(Previews.FLASH)</span>
<span class="fc" id="L203"> .toIterable(GHDeploymentStatus[].class, item -&gt; item.wrap(owner));</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>