author | Mikael Berthe <mikael@lilotux.net> |
Mon, 30 May 2022 18:45:45 +0200 | |
changeset 256 | 6d748fac6eb2 |
parent 238 | 1c0042e76902 |
permissions | -rw-r--r-- |
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 |
|
238
1c0042e76902
Do not use a global API version
Mikael Berthe <mikael@lilotux.net>
parents:
233
diff
changeset
|
20 |
if err := mc.apiCall("v1/"+endPoint, method, nil, lopt, nil, &accountList); err != nil { |
233 | 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 |
|
238
1c0042e76902
Do not use a global API version
Mikael Berthe <mikael@lilotux.net>
parents:
233
diff
changeset
|
30 |
return mc.apiCall("v1/"+endPoint, method, nil, nil, nil, nil) |
233 | 31 |
} |