mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-22 08:21:25 +00:00
56 lines
3.0 KiB
HTML
56 lines
3.0 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>GHInvitation.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">GHInvitation.java</span></div><h1>GHInvitation.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;
|
|
|
|
/**
|
|
* The type GHInvitation.
|
|
*
|
|
* @see GitHub#getMyInvitations() GitHub#getMyInvitations()
|
|
* @see GHRepository#listInvitations() GHRepository#listInvitations()
|
|
*/
|
|
@SuppressFBWarnings(
|
|
value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD",
|
|
"UUF_UNUSED_FIELD" },
|
|
justification = "JSON API")
|
|
<span class="nc" id="L18">public class GHInvitation extends GHObject {</span>
|
|
|
|
private int id;
|
|
private GHRepository repository;
|
|
private GHUser invitee, inviter;
|
|
private String permissions;
|
|
private String html_url;
|
|
|
|
GHInvitation wrapUp(GitHub root) {
|
|
<span class="nc" id="L27"> this.root = root;</span>
|
|
<span class="nc" id="L28"> return this;</span>
|
|
}
|
|
|
|
/**
|
|
* Accept a repository invitation.
|
|
*
|
|
* @throws IOException
|
|
* the io exception
|
|
*/
|
|
public void accept() throws IOException {
|
|
<span class="nc" id="L38"> root.createRequest().method("PATCH").withUrlPath("/user/repository_invitations/" + id).send();</span>
|
|
<span class="nc" id="L39"> }</span>
|
|
|
|
/**
|
|
* Decline a repository invitation.
|
|
*
|
|
* @throws IOException
|
|
* the io exception
|
|
*/
|
|
public void decline() throws IOException {
|
|
<span class="nc" id="L48"> root.createRequest().method("DELETE").withUrlPath("/user/repository_invitations/" + id).send();</span>
|
|
<span class="nc" id="L49"> }</span>
|
|
|
|
@Override
|
|
public URL getHtmlUrl() {
|
|
<span class="nc" id="L53"> return GitHubClient.parseURL(html_url);</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> |