package org.kohsuke.github;

import java.io.IOException;
import java.net.URL;

/**
 * A discussion in GitHub Team.
 *
 * @author Charles Moulliard
 */
public class GHDiscussion extends GHObject {

    @JacksonInject
    private GitHub root;
    private GHOrganization organization;
    private GHTeam team;
    private String body, title, htmlUrl;

    @Override
    public URL getHtmlUrl() throws IOException {
        return GitHubClient.parseURL(html_url);
    }

    public GHDiscussion wrapUp(GHTeam team) throws IOException {
        this.organization = team.getOrganization();
        this.team = team;
        return this;
    }

    public GHDiscussion wrapUp(GitHub root) {
        this.root = root;
        return this;
    }

    public GHDiscussion wrapUp(GHOrganization owner) {
        this.organization = owner;
        this.root = owner.root;
        return this;
    }

    /**
     * Get the title of the discussion.
     *
     * @return the title
     */
    public String getTitle() {
        return title;
    }

    /**
     * The description of this discussion.
     *
     * @return the body
     */
    public String getBody() {
        return body;
    }
}

package org.kohsuke.github;

import java.io.IOException;
import java.net.URL;

/**
 * A discussion in GitHub Team.
 *
 * @author Charles Moulliard
 */
public class GHDiscussion extends GHObject {

    @JacksonInject
    private GitHub root;
    private GHOrganization organization;
    private GHTeam team;
    private String body, title, htmlUrl;

    @Override
    public URL getHtmlUrl() throws IOException {
        return GitHubClient.parseURL(html_url);
    }

    public GHDiscussion wrapUp(GHTeam team) throws IOException {
        this.organization = team.getOrganization();
        this.team = team;
        return this;
    }

    public GHDiscussion wrapUp(GitHub root) {
        this.root = root;
        return this;
    }

    public GHDiscussion wrapUp(GHOrganization owner) {
        this.organization = owner;
        return this;
    }

    /**
     * Get the title of the discussion.
     *
     * @return the title
     */
    public String getTitle() {
        return title;
    }

    /**
     * The description of this discussion.
     *
     * @return the body
     */
    public String getBody() {
        return body;
    }
}

Update src/main/java/org/kohsuke/github/GHDiscussion.java