@@ -361,6 +361,50 @@ public Stream<Discussion> getMergeRequestDiscussionsStream(Object projectIdOrPat
361361 return (pager .stream ());
362362 }
363363
364+ /**
365+ * Get a single discussion for the specified merge request.
366+ *
367+ * <pre><code>GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id</code></pre>
368+ *
369+ * @param projectIdOrPath projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
370+ * @param mergeRequestIid the internal ID of the merge request
371+ * @param discussionId the ID of the discussion
372+ * @return the Discussion instance specified by discussionId for the specified merge request
373+ * @throws GitLabApiException if any exception occurs during execution
374+ */
375+ public Discussion getMergeRequestDiscussion (Object projectIdOrPath , Long mergeRequestIid , String discussionId )
376+ throws GitLabApiException {
377+ Response response = get (
378+ Response .Status .OK ,
379+ null ,
380+ "projects" ,
381+ getProjectIdOrPath (projectIdOrPath ),
382+ "merge_requests" ,
383+ mergeRequestIid ,
384+ "discussions" ,
385+ discussionId );
386+ return (response .readEntity (Discussion .class ));
387+ }
388+
389+ /**
390+ * Get an Optional instance of a single discussion for the specified merge request.
391+ *
392+ * <pre><code>GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id</code></pre>
393+ *
394+ * @param projectIdOrPath projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
395+ * @param mergeRequestIid the internal ID of the merge request
396+ * @param discussionId the ID of the discussion
397+ * @return an Optional instance with the specified Discussion instance as a value
398+ */
399+ public Optional <Discussion > getOptionalMergeRequestDiscussion (
400+ Object projectIdOrPath , Long mergeRequestIid , String discussionId ) throws GitLabApiException {
401+ try {
402+ return (Optional .ofNullable (getMergeRequestDiscussion (projectIdOrPath , mergeRequestIid , discussionId )));
403+ } catch (GitLabApiException glae ) {
404+ return (GitLabApi .createOptionalFromException (glae ));
405+ }
406+ }
407+
364408 /**
365409 * Creates a new discussion to a single project merge request. This is similar to creating
366410 * a note but other comments (replies) can be added to it later.
0 commit comments