mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-23 15:51:36 +00:00
feat: add new APi for Discussion
This commit is contained in:
@@ -130,6 +130,19 @@ public class GHTeam extends GHObject implements Refreshable {
|
||||
root.createRequest().method("PATCH").with("privacy", privacy).withUrlPath(api("")).send();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the discussions.
|
||||
*
|
||||
* @return the paged iterable
|
||||
* @throws IOException
|
||||
* the io exception
|
||||
*/
|
||||
public PagedIterable<GHDiscussion> listDiscussions() throws IOException {
|
||||
return root.createRequest()
|
||||
.withUrlPath(api("/discussions"))
|
||||
.toIterable(GHDiscussion[].class, item -> item.wrapUp(root));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the current members.
|
||||
*
|
||||
@@ -297,6 +310,21 @@ public class GHTeam extends GHObject implements Refreshable {
|
||||
return "/teams/" + getId() + tail;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts a builder that creates a new discussion.
|
||||
*
|
||||
* <p>
|
||||
* You use the returned builder to set various properties, then call {@link GHDiscussionBuilder#create()} to finally
|
||||
* create a discussion.
|
||||
*
|
||||
* @param name
|
||||
* the name
|
||||
* @return the gh create discussion builder
|
||||
*/
|
||||
public GHDiscussionBuilder createDiscussion(String name) throws IOException {
|
||||
return new GHDiscussionBuilder(this, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets organization.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user