func (mg *MailgunImpl) GetMembers(limit, skip int, s *bool, addr string) (int, []Member, error) {
	r := newHTTPRequest(generateMemberApiUrl(mg, listsEndpoint, addr))
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.ApiKey())
	p := newUrlEncodedPayload()
	if limit != DefaultLimit {
		p.addValue("limit", strconv.Itoa(limit))
	}
	if skip != DefaultSkip {
		p.addValue("skip", strconv.Itoa(skip))
	}
	if s != nil {
		p.addValue("subscribed", yesNo(*s))
	}
	var envelope struct {
		TotalCount int      `json:"total_count"`
		Items      []Member `json:"items"`
	}
	response, err := makeRequest(r, "GET", p)
	if err != nil {
		return -1, nil, err
	}
	err = response.parseFromJSON(&envelope)
	return envelope.TotalCount, envelope.Items, err
}
GetMembers returns the list of members belonging to the indicated mailing list.
The s parameter can be set to one of three settings to help narrow the returned data set:
All indicates that you want both Members and unsubscribed members alike, while
Subscribed and Unsubscribed indicate you want only those eponymous subsets.
package mailgun
import (
	"encoding/json"
	"fmt"
	"strconv"
)
const (
	ReadOnly = "readonly"
	Members  = "members"
	Everyone = "everyone"
)
var (
	All          *bool = nil
	Subscribed   *bool = &yes
	Unsubscribed *bool = &no
)
var (
	yes bool = true
	no  bool = false
)
type List struct {
	Address      string `json:"address",omitempty"`
	Name         string `json:"name",omitempty"`
	Description  string `json:"description",omitempty"`
	AccessLevel  string `json:"access_level",omitempty"`
	CreatedAt    string `json:"created_at",omitempty"`
	MembersCount int    `json:"members_count",omitempty"`
}
type Member struct {
	Address    string                 `json:"address,omitempty"`
	Name       string                 `json:"name,omitempty"`
	Subscribed *bool                  `json:"subscribed,omitempty"`
	Vars       map[string]interface{} `json:"vars,omitempty"`
}
func (mg *MailgunImpl) GetLists(limit, skip int, filter string) (int, []List, error) {
	r := newHTTPRequest(generatePublicApiUrl(mg, listsEndpoint))
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.ApiKey())
	p := newUrlEncodedPayload()
	if limit != DefaultLimit {
		p.addValue("limit", strconv.Itoa(limit))
	}
	if skip != DefaultSkip {
		p.addValue("skip", strconv.Itoa(skip))
	}
	if filter != "" {
		p.addValue("address", filter)
	}
	var envelope struct {
		Items      []List `json:"items"`
		TotalCount int    `json:"total_count"`
	}
	response, err := makeRequest(r, "GET", p)
	if err != nil {
		return -1, nil, err
	}
	err = response.parseFromJSON(&envelope)
	return envelope.TotalCount, envelope.Items, err
}
func (mg *MailgunImpl) CreateList(prototype List) (List, error) {
	r := newHTTPRequest(generatePublicApiUrl(mg, listsEndpoint))
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.ApiKey())
	p := newUrlEncodedPayload()
	if prototype.Address != "" {
		p.addValue("address", prototype.Address)
	}
	if prototype.Name != "" {
		p.addValue("name", prototype.Name)
	}
	if prototype.Description != "" {
		p.addValue("description", prototype.Description)
	}
	if prototype.AccessLevel != "" {
		p.addValue("access_level", prototype.AccessLevel)
	}
	response, err := makePostRequest(r, p)
	if err != nil {
		return List{}, err
	}
	var l List
	err = response.parseFromJSON(&l)
	return l, err
}
func (mg *MailgunImpl) DeleteList(addr string) error {
	r := newHTTPRequest(generatePublicApiUrl(mg, listsEndpoint) + "/" + addr)
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.ApiKey())
	_, err := makeDeleteRequest(r)
	return err
}
func (mg *MailgunImpl) GetListByAddress(addr string) (List, error) {
	r := newHTTPRequest(generatePublicApiUrl(mg, listsEndpoint) + "/" + addr)
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.ApiKey())
	response, err := makeGetRequest(r)
	if err != nil {
		return List{}, err
	}
	var envelope struct {
		List `json:"list"`
	}
	err = response.parseFromJSON(&envelope)
	return envelope.List, err
}
func (mg *MailgunImpl) UpdateList(addr string, prototype List) (List, error) {
	r := newHTTPRequest(generatePublicApiUrl(mg, listsEndpoint) + "/" + addr)
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.ApiKey())
	p := newUrlEncodedPayload()
	if prototype.Address != "" {
		p.addValue("address", prototype.Address)
	}
	if prototype.Name != "" {
		p.addValue("name", prototype.Name)
	}
	if prototype.Description != "" {
		p.addValue("description", prototype.Description)
	}
	if prototype.AccessLevel != "" {
		p.addValue("access_level", prototype.AccessLevel)
	}
	var l List
	response, err := makePutRequest(r, p)
	if err != nil {
		return l, err
	}
	err = response.parseFromJSON(&l)
	return l, err
}