mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-16 15:50:19 +00:00
151 lines
5.6 KiB
HTML
151 lines
5.6 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>GHAppInstallationToken.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">GHAppInstallationToken.java</span></div><h1>GHAppInstallationToken.java</h1><pre class="source lang-java linenums">package org.kohsuke.github;
|
|
|
|
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
|
|
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
|
|
|
import java.io.IOException;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* A Github App Installation Token.
|
|
*
|
|
* @author Paulo Miguel Almeida
|
|
* @see GHAppInstallation#createToken(Map) GHAppInstallation#createToken(Map)
|
|
*/
|
|
<span class="fc" id="L17">public class GHAppInstallationToken extends GitHubInteractiveObject {</span>
|
|
private String token;
|
|
protected String expires_at;
|
|
private Map<String, String> permissions;
|
|
private List<GHRepository> repositories;
|
|
private GHRepositorySelection repositorySelection;
|
|
|
|
/**
|
|
* Gets root.
|
|
*
|
|
* @return the root
|
|
*/
|
|
public GitHub getRoot() {
|
|
<span class="nc" id="L30"> return root;</span>
|
|
}
|
|
|
|
/**
|
|
* Sets root.
|
|
*
|
|
* @param root
|
|
* the root
|
|
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
|
|
*/
|
|
@Deprecated
|
|
public void setRoot(GitHub root) {
|
|
<span class="nc" id="L42"> this.root = root;</span>
|
|
<span class="nc" id="L43"> }</span>
|
|
|
|
/**
|
|
* Gets permissions.
|
|
*
|
|
* @return the permissions
|
|
*/
|
|
public Map<String, String> getPermissions() {
|
|
<span class="fc" id="L51"> return permissions;</span>
|
|
}
|
|
|
|
/**
|
|
* Sets permissions.
|
|
*
|
|
* @param permissions
|
|
* the permissions
|
|
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
|
|
*/
|
|
@Deprecated
|
|
public void setPermissions(Map<String, String> permissions) {
|
|
<span class="nc" id="L63"> this.permissions = permissions;</span>
|
|
<span class="nc" id="L64"> }</span>
|
|
|
|
/**
|
|
* Gets token.
|
|
*
|
|
* @return the token
|
|
*/
|
|
public String getToken() {
|
|
<span class="fc" id="L72"> return token;</span>
|
|
}
|
|
|
|
/**
|
|
* Sets token.
|
|
*
|
|
* @param token
|
|
* the token
|
|
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
|
|
*/
|
|
@Deprecated
|
|
public void setToken(String token) {
|
|
<span class="nc" id="L84"> this.token = token;</span>
|
|
<span class="nc" id="L85"> }</span>
|
|
|
|
/**
|
|
* Gets repositories.
|
|
*
|
|
* @return the repositories
|
|
*/
|
|
public List<GHRepository> getRepositories() {
|
|
<span class="fc" id="L93"> return repositories;</span>
|
|
}
|
|
|
|
/**
|
|
* Sets repositories.
|
|
*
|
|
* @param repositories
|
|
* the repositories
|
|
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
|
|
*/
|
|
@Deprecated
|
|
public void setRepositories(List<GHRepository> repositories) {
|
|
<span class="nc" id="L105"> this.repositories = repositories;</span>
|
|
<span class="nc" id="L106"> }</span>
|
|
|
|
/**
|
|
* Gets repository selection.
|
|
*
|
|
* @return the repository selection
|
|
*/
|
|
public GHRepositorySelection getRepositorySelection() {
|
|
<span class="fc" id="L114"> return repositorySelection;</span>
|
|
}
|
|
|
|
/**
|
|
* Sets repository selection.
|
|
*
|
|
* @param repositorySelection
|
|
* the repository selection
|
|
* @deprecated Do not use this method. It was added due to incomplete understanding of Jackson binding.
|
|
*/
|
|
@Deprecated
|
|
public void setRepositorySelection(GHRepositorySelection repositorySelection) {
|
|
<span class="nc" id="L126"> this.repositorySelection = repositorySelection;</span>
|
|
<span class="nc" id="L127"> }</span>
|
|
|
|
/**
|
|
* Gets expires at.
|
|
*
|
|
* @return date when this token expires
|
|
* @throws IOException
|
|
* on error
|
|
*/
|
|
@WithBridgeMethods(value = String.class, adapterMethod = "expiresAtStr")
|
|
public Date getExpiresAt() throws IOException {
|
|
<span class="fc" id="L138"> return GitHubClient.parseDate(expires_at);</span>
|
|
}
|
|
|
|
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", justification = "Bridge method of getExpiresAt")
|
|
private Object expiresAtStr(Date id, Class type) {
|
|
<span class="nc" id="L143"> return expires_at;</span>
|
|
}
|
|
|
|
GHAppInstallationToken wrapUp(GitHub root) {
|
|
<span class="fc" id="L147"> this.root = root;</span>
|
|
<span class="fc" id="L148"> return this;</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> |