Commit b75a71e9 authored by Sune Keller's avatar Sune Keller Committed by Sander van Harmelen

Add Discussions API implementation (#481)

Add Discussions API implementation
parent b9570190
This diff is collapsed.
......@@ -287,6 +287,7 @@ type Client struct {
CustomAttribute *CustomAttributesService
DeployKeys *DeployKeysService
Deployments *DeploymentsService
Discussions *DiscussionsService
Environments *EnvironmentsService
Events *EventsService
Features *FeaturesService
......@@ -426,6 +427,7 @@ func newClient(httpClient *http.Client) *Client {
c.CustomAttribute = &CustomAttributesService{client: c}
c.DeployKeys = &DeployKeysService{client: c}
c.Deployments = &DeploymentsService{client: c}
c.Discussions = &DiscussionsService{client: c}
c.Environments = &EnvironmentsService{client: c}
c.Events = &EventsService{client: c}
c.Features = &FeaturesService{client: c}
......
......@@ -40,22 +40,49 @@ type Note struct {
Title string `json:"title"`
FileName string `json:"file_name"`
Author struct {
ID int `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Name string `json:"name"`
State string `json:"state"`
CreatedAt *time.Time `json:"created_at"`
AvatarURL string `json:"avatar_url"`
WebURL string `json:"web_url"`
ID int `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Name string `json:"name"`
State string `json:"state"`
AvatarURL string `json:"avatar_url"`
WebURL string `json:"web_url"`
} `json:"author"`
System bool `json:"system"`
ExpiresAt *time.Time `json:"expires_at"`
UpdatedAt *time.Time `json:"updated_at"`
CreatedAt *time.Time `json:"created_at"`
NoteableID int `json:"noteable_id"`
NoteableType string `json:"noteable_type"`
NoteableIID int `json:"noteable_iid"`
System bool `json:"system"`
ExpiresAt *time.Time `json:"expires_at"`
UpdatedAt *time.Time `json:"updated_at"`
CreatedAt *time.Time `json:"created_at"`
NoteableID int `json:"noteable_id"`
NoteableType string `json:"noteable_type"`
Position *NotePosition `json:"position"`
Resolvable bool `json:"resolvable"`
Resolved bool `json:"resolved"`
ResolvedBy struct {
ID int `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Name string `json:"name"`
State string `json:"state"`
AvatarURL string `json:"avatar_url"`
WebURL string `json:"web_url"`
} `json:"resolved_by"`
NoteableIID int `json:"noteable_iid"`
}
// NotePosition represents the "position" attributes on a note
type NotePosition struct {
BaseSHA string `json:"base_sha"`
StartSHA string `json:"start_sha"`
HeadSHA string `json:"head_sha"`
PositionType string `json:"position_type"`
NewPath string `json:"new_path,omitempty"`
NewLine int `json:"new_line,omitempty"`
OldPath string `json:"old_path,omitempty"`
OldLine int `json:"old_line,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
X int `json:"x,omitempty"`
Y int `json:"y,omitempty"`
}
func (n Note) String() string {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment