mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-05 08:21:21 +00:00
Update to v1.109
This commit is contained in:
102
jacoco/org.kohsuke.github/GHHook.java.html
Normal file
102
jacoco/org.kohsuke.github/GHHook.java.html
Normal file
@@ -0,0 +1,102 @@
|
||||
<?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>GHHook.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">GHHook.java</span></div><h1>GHHook.java</h1><pre class="source lang-java linenums">package org.kohsuke.github;
|
||||
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* The type GHHook.
|
||||
*
|
||||
* @author Kohsuke Kawaguchi
|
||||
*/
|
||||
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
|
||||
justification = "JSON API")
|
||||
<span class="fc" id="L20">public abstract class GHHook extends GHObject {</span>
|
||||
String name;
|
||||
List<String> events;
|
||||
boolean active;
|
||||
Map<String, String> config;
|
||||
|
||||
/**
|
||||
* Gets name.
|
||||
*
|
||||
* @return the name
|
||||
*/
|
||||
public String getName() {
|
||||
<span class="nc" id="L32"> return name;</span>
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets events.
|
||||
*
|
||||
* @return the events
|
||||
*/
|
||||
public EnumSet<GHEvent> getEvents() {
|
||||
<span class="nc" id="L41"> EnumSet<GHEvent> s = EnumSet.noneOf(GHEvent.class);</span>
|
||||
<span class="nc bnc" id="L42" title="All 2 branches missed."> for (String e : events) {</span>
|
||||
<span class="nc bnc" id="L43" title="All 2 branches missed."> if (e.equals("*"))</span>
|
||||
<span class="nc" id="L44"> s.add(GHEvent.ALL);</span>
|
||||
else
|
||||
<span class="nc" id="L46"> s.add(Enum.valueOf(GHEvent.class, e.toUpperCase(Locale.ENGLISH)));</span>
|
||||
<span class="nc" id="L47"> }</span>
|
||||
<span class="nc" id="L48"> return s;</span>
|
||||
}
|
||||
|
||||
/**
|
||||
* Is active boolean.
|
||||
*
|
||||
* @return the boolean
|
||||
*/
|
||||
public boolean isActive() {
|
||||
<span class="nc" id="L57"> return active;</span>
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets config.
|
||||
*
|
||||
* @return the config
|
||||
*/
|
||||
public Map<String, String> getConfig() {
|
||||
<span class="nc" id="L66"> return Collections.unmodifiableMap(config);</span>
|
||||
}
|
||||
|
||||
/**
|
||||
* Ping.
|
||||
*
|
||||
* @throws IOException
|
||||
* the io exception
|
||||
* @see <a href="https://developer.github.com/v3/repos/hooks/#ping-a-hook">Ping hook</a>
|
||||
*/
|
||||
public void ping() throws IOException {
|
||||
<span class="nc" id="L77"> getRoot().createRequest().method("POST").withUrlPath(getApiRoute() + "/pings").send();</span>
|
||||
<span class="nc" id="L78"> }</span>
|
||||
|
||||
/**
|
||||
* Deletes this hook.
|
||||
*
|
||||
* @throws IOException
|
||||
* the io exception
|
||||
*/
|
||||
public void delete() throws IOException {
|
||||
<span class="nc" id="L87"> getRoot().createRequest().method("DELETE").withUrlPath(getApiRoute()).send();</span>
|
||||
<span class="nc" id="L88"> }</span>
|
||||
|
||||
/**
|
||||
* @deprecated This object has no HTML URL.
|
||||
*/
|
||||
@Override
|
||||
public URL getHtmlUrl() {
|
||||
<span class="nc" id="L95"> return null;</span>
|
||||
}
|
||||
|
||||
abstract GitHub getRoot();
|
||||
|
||||
abstract String getApiRoute();
|
||||
}
|
||||
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.5.201910111838</span></div></body></html>
|
||||
Reference in New Issue
Block a user