func (sc *Client) ListCorps() ([]Corp, error) {
	resp, err := sc.doRequest("GET", "/v0/corps", "")
	if err != nil {
		return []Corp{}, err
	}
	var cr corpsResponse
	err = json.Unmarshal(resp, &cr)
	if err != nil {
		return []Corp{}, err
	}
	return cr.Data, nil
}
ListCorps lists corps.
package sigsci
import (
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"strings"
	"time"
)
const apiURL = "https://dashboard.signalsciences.net/api"
type Client struct {
	email string
	token string
}
func NewClient(email, password string) (Client, error) {
	sc := Client{}
	err := sc.authenticate(email, password)
	if err != nil {
		return Client{}, err
	}
	return sc, nil
}
func NewTokenClient(email, token string) Client {
	return Client{
		email: email,
		token: token,
	}
}
func (sc *Client) authenticate(email, password string) error {
	resp, err := http.PostForm(apiURL+"/v0/auth", url.Values{"email": {email}, "password": {password}})
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	var tr struct {
		Token string
	}
	err = json.NewDecoder(resp.Body).Decode(&tr)
	if err != nil {
		return err
	}
	sc.token = tr.Token
	return nil
}
func (sc *Client) doRequest(method, url, reqBody string) ([]byte, error) {
	client := &http.Client{}
	var b io.Reader
	if reqBody != "" {
		b = strings.NewReader(reqBody)
	}
	req, err := http.NewRequest(method, apiURL+url, b)
	if err != nil {
		return []byte{}, err
	}
	if sc.email != "" {
		req.Header.Set("X-API-User", sc.email)
		req.Header.Set("X-API-Token", sc.token)
	} else {
		req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", sc.token))
	}
	req.Header.Add("Content-Type", "application/json")
	req.Header.Set("User-Agent", "go-sigsci")
	resp, err := client.Do(req)
	if err != nil {
		return []byte{}, err
	}
	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return []byte{}, err
	}
	switch method {
	case "GET":
		if resp.StatusCode != http.StatusOK {
			return body, errMsg(body)
		}
	case "POST":
		switch resp.StatusCode {
		case http.StatusOK, http.StatusCreated, http.StatusNoContent:
		default:
			return body, errMsg(body)
		}
	case "DELETE":
		if resp.StatusCode != http.StatusNoContent {
			return body, errMsg(body)
		}
	case "PATCH":
		if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusNoContent {
			return body, errMsg(body)
		}
	}
	return body, nil
}
func errMsg(b []byte) error {
	var errResp struct {
		Message string
	}
	err := json.Unmarshal(b, &errResp)
	if err != nil {
		return err
	}
	return errors.New(errResp.Message)
}
type Corp struct {
	Name                   string
	DisplayName            string
	SmallIconURI           string
	Created                time.Time
	SiteLimit              int
	Sites                  map[string]string
	AuthType               string
	MFAEnforced            bool
	SessionMaxAgeDashboard int
}
type corpsResponse struct {
	Data []Corp
}