Use links from headers
Keep querying the API until the requested limit is reached, using the
headers. If no limit is set, a single query is made.
/*
Copyright 2017 Mikael Berthe
Licensed under the MIT license. Please see the LICENSE file is this directory.
*/
package madon
import (
"github.com/sendgrid/rest"
)
// GetCurrentInstance returns current instance information
func (mc *Client) GetCurrentInstance() (*Instance, error) {
var i Instance
if err := mc.apiCall("instance", rest.Get, nil, nil, nil, &i); err != nil {
return nil, err
}
return &i, nil
}