233
|
1 |
/* |
|
2 |
Copyright 2018 Mikael Berthe |
|
3 |
|
|
4 |
Licensed under the MIT license. Please see the LICENSE file is this directory. |
|
5 |
*/ |
|
6 |
|
|
7 |
package madon |
|
8 |
|
|
9 |
import ( |
|
10 |
"strconv" |
|
11 |
|
|
12 |
"github.com/sendgrid/rest" |
|
13 |
) |
|
14 |
|
|
15 |
// GetSuggestions returns a list of follow suggestions from the server |
|
16 |
func (mc *Client) GetSuggestions(lopt *LimitParams) ([]Account, error) { |
|
17 |
endPoint := "suggestions" |
|
18 |
method := rest.Get |
|
19 |
var accountList []Account |
|
20 |
if err := mc.apiCall(endPoint, method, nil, lopt, nil, &accountList); err != nil { |
|
21 |
return nil, err |
|
22 |
} |
|
23 |
return accountList, nil |
|
24 |
} |
|
25 |
|
|
26 |
// DeleteSuggestion removes the account from the suggestion list |
|
27 |
func (mc *Client) DeleteSuggestion(accountID int64) error { |
|
28 |
endPoint := "suggestions/" + strconv.FormatInt(accountID, 10) |
|
29 |
method := rest.Delete |
|
30 |
return mc.apiCall(endPoint, method, nil, nil, nil, nil) |
|
31 |
} |