-
Notifications
You must be signed in to change notification settings - Fork 59
/
misc.go
37 lines (31 loc) · 879 Bytes
/
misc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package buildkite
import (
"context"
"fmt"
)
// Emoji emoji, what else can you say?
type Emoji struct {
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"`
}
// ListEmojis list all the emojis for a given account, including custom emojis and aliases.
//
// buildkite API docs: https://buildkite.com/docs/api/emojis
func (c *Client) ListEmojis(ctx context.Context, org string) ([]Emoji, *Response, error) {
u := fmt.Sprintf("v2/organizations/%s/emojis", org)
req, err := c.NewRequest(ctx, "GET", u, nil)
if err != nil {
return nil, nil, err
}
var emoji []Emoji
resp, err := c.Do(req, &emoji)
if err != nil {
return nil, resp, err
}
return emoji, resp, nil
}
// Token an oauth access token for the buildkite service
type Token struct {
AccessToken string `json:"access_token,omitempty"`
Type string `json:"token_type,omitempty"`
}