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 { ...@@ -287,6 +287,7 @@ type Client struct {
CustomAttribute *CustomAttributesService CustomAttribute *CustomAttributesService
DeployKeys *DeployKeysService DeployKeys *DeployKeysService
Deployments *DeploymentsService Deployments *DeploymentsService
Discussions *DiscussionsService
Environments *EnvironmentsService Environments *EnvironmentsService
Events *EventsService Events *EventsService
Features *FeaturesService Features *FeaturesService
...@@ -426,6 +427,7 @@ func newClient(httpClient *http.Client) *Client { ...@@ -426,6 +427,7 @@ func newClient(httpClient *http.Client) *Client {
c.CustomAttribute = &CustomAttributesService{client: c} c.CustomAttribute = &CustomAttributesService{client: c}
c.DeployKeys = &DeployKeysService{client: c} c.DeployKeys = &DeployKeysService{client: c}
c.Deployments = &DeploymentsService{client: c} c.Deployments = &DeploymentsService{client: c}
c.Discussions = &DiscussionsService{client: c}
c.Environments = &EnvironmentsService{client: c} c.Environments = &EnvironmentsService{client: c}
c.Events = &EventsService{client: c} c.Events = &EventsService{client: c}
c.Features = &FeaturesService{client: c} c.Features = &FeaturesService{client: c}
......
...@@ -45,7 +45,6 @@ type Note struct { ...@@ -45,7 +45,6 @@ type Note struct {
Email string `json:"email"` Email string `json:"email"`
Name string `json:"name"` Name string `json:"name"`
State string `json:"state"` State string `json:"state"`
CreatedAt *time.Time `json:"created_at"`
AvatarURL string `json:"avatar_url"` AvatarURL string `json:"avatar_url"`
WebURL string `json:"web_url"` WebURL string `json:"web_url"`
} `json:"author"` } `json:"author"`
...@@ -55,9 +54,37 @@ type Note struct { ...@@ -55,9 +54,37 @@ type Note struct {
CreatedAt *time.Time `json:"created_at"` CreatedAt *time.Time `json:"created_at"`
NoteableID int `json:"noteable_id"` NoteableID int `json:"noteable_id"`
NoteableType string `json:"noteable_type"` 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"` 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 { func (n Note) String() string {
return Stringify(n) return Stringify(n)
} }
......
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