mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-11 15:50:17 +00:00
91 lines
3.3 KiB
HTML
91 lines
3.3 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>GHDeployKey.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">GHDeployKey.java</span></div><h1>GHDeployKey.java</h1><pre class="source lang-java linenums">package org.kohsuke.github;
|
|
|
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
|
|
import java.io.IOException;
|
|
|
|
/**
|
|
* The type GHDeployKey.
|
|
*/
|
|
<span class="nc" id="L10">public class GHDeployKey {</span>
|
|
|
|
protected String url, key, title;
|
|
protected boolean verified;
|
|
protected long id;
|
|
private GHRepository owner;
|
|
|
|
/**
|
|
* Gets id.
|
|
*
|
|
* @return the id
|
|
*/
|
|
public long getId() {
|
|
<span class="nc" id="L23"> return id;</span>
|
|
}
|
|
|
|
/**
|
|
* Gets key.
|
|
*
|
|
* @return the key
|
|
*/
|
|
public String getKey() {
|
|
<span class="nc" id="L32"> return key;</span>
|
|
}
|
|
|
|
/**
|
|
* Gets title.
|
|
*
|
|
* @return the title
|
|
*/
|
|
public String getTitle() {
|
|
<span class="nc" id="L41"> return title;</span>
|
|
}
|
|
|
|
/**
|
|
* Gets url.
|
|
*
|
|
* @return the url
|
|
*/
|
|
public String getUrl() {
|
|
<span class="nc" id="L50"> return url;</span>
|
|
}
|
|
|
|
/**
|
|
* Is verified boolean.
|
|
*
|
|
* @return the boolean
|
|
*/
|
|
public boolean isVerified() {
|
|
<span class="nc" id="L59"> return verified;</span>
|
|
}
|
|
|
|
/**
|
|
* Wrap gh deploy key.
|
|
*
|
|
* @param repo
|
|
* the repo
|
|
* @return the gh deploy key
|
|
*/
|
|
public GHDeployKey wrap(GHRepository repo) {
|
|
<span class="nc" id="L70"> this.owner = repo;</span>
|
|
<span class="nc" id="L71"> return this;</span>
|
|
}
|
|
|
|
public String toString() {
|
|
<span class="nc" id="L75"> return new ToStringBuilder(this).append("title", title).append("id", id).append("key", key).toString();</span>
|
|
}
|
|
|
|
/**
|
|
* Delete.
|
|
*
|
|
* @throws IOException
|
|
* the io exception
|
|
*/
|
|
public void delete() throws IOException {
|
|
<span class="nc" id="L85"> owner.root.createRequest()</span>
|
|
<span class="nc" id="L86"> .method("DELETE")</span>
|
|
<span class="nc" id="L87"> .withUrlPath(String.format("/repos/%s/%s/keys/%d", owner.getOwnerName(), owner.getName(), id))</span>
|
|
<span class="nc" id="L88"> .send();</span>
|
|
<span class="nc" id="L89"> }</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> |