-
Notifications
You must be signed in to change notification settings - Fork 726
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add payload for discussion_comment event (#1781)
- Loading branch information
Showing
4 changed files
with
428 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
src/main/java/org/kohsuke/github/GHRepositoryDiscussionComment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
package org.kohsuke.github; | ||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
|
||
/** | ||
* A discussion comment in the repository. | ||
* <p> | ||
* This is different from Teams discussions (see {@link GHDiscussion}). | ||
* <p> | ||
* The discussion_comment event exposes the GraphQL object (more or less - the ids are handled differently for instance) | ||
* directly. The new Discussions API is only available through GraphQL so for now you cannot execute any actions on this | ||
* object. | ||
* | ||
* @author Guillaume Smet | ||
* @see <a href="https://docs.github.com/en/graphql/guides/using-the-graphql-api-for-discussions#discussion">The GraphQL | ||
* API for Discussions</a> | ||
*/ | ||
public class GHRepositoryDiscussionComment extends GHObject { | ||
|
||
private String htmlUrl; | ||
|
||
private Long parentId; | ||
private int childCommentCount; | ||
|
||
private GHUser user; | ||
private GHCommentAuthorAssociation authorAssociation; | ||
private String body; | ||
|
||
/** | ||
* Gets the html url. | ||
* | ||
* @return the html url | ||
*/ | ||
public URL getHtmlUrl() { | ||
return GitHubClient.parseURL(htmlUrl); | ||
} | ||
|
||
/** | ||
* Gets the parent comment id. | ||
* | ||
* @return the parent comment id | ||
*/ | ||
public Long getParentId() { | ||
return parentId; | ||
} | ||
|
||
/** | ||
* Gets the number of child comments. | ||
* | ||
* @return the number of child comments | ||
*/ | ||
public int getChildCommentCount() { | ||
return childCommentCount; | ||
} | ||
|
||
/** | ||
* Gets the user. | ||
* | ||
* @return the user | ||
* @throws IOException | ||
* Signals that an I/O exception has occurred. | ||
*/ | ||
public GHUser getUser() throws IOException { | ||
return root().intern(user); | ||
} | ||
|
||
/** | ||
* Gets the author association. | ||
* | ||
* @return the author association | ||
*/ | ||
public GHCommentAuthorAssociation getAuthorAssociation() { | ||
return authorAssociation; | ||
} | ||
|
||
/** | ||
* Gets the body. | ||
* | ||
* @return the body | ||
*/ | ||
public String getBody() { | ||
return body; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.