vendor/github.com/McKael/madon/v3/suggestions.go
changeset 265 05c40b36d3b2
parent 242 2a9ec03fe5a1
child 268 4dd196a4ee7c
equal deleted inserted replaced
264:8f478162d991 265:05c40b36d3b2
       
     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("v1/"+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("v1/"+endPoint, method, nil, nil, nil, nil)
       
    31 }