<commit_before>package mailgun

import (
	"context"
	"encoding/json"
	"strconv"
)

// yes and no are variables which provide us the ability to take their addresses.
// Subscribed and Unsubscribed are pointers to these booleans.
//
// We use a pointer to boolean as a kind of trinary data type:
// if nil, the relevant data type remains unspecified.
// Otherwise, its value is either true or false.
var (
	yes bool = true
	no  bool = false
)

// Mailing list members have an attribute that determines if they've subscribed to the mailing list or not.
// This attribute may be used to filter the results returned by GetSubscribers().
// All, Subscribed, and Unsubscribed provides a convenient and readable syntax for specifying the scope of the search.
var (
	All          *bool = nil
	Subscribed   *bool = &yes
	Unsubscribed *bool = &no
)

// A Member structure represents a member of the mailing list.
// The Vars field can represent any JSON-encodable data.
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"`
}

type memberListResponse struct {
	Lists  []Member `json:"items"`
	Paging Paging   `json:"paging"`
}

type memberResponse struct {
	Member Member `json:"list"`
}

type MemberListIterator struct {
	memberListResponse
	mg  Mailgun
	err error
}

// Used by List methods to specify what list parameters to send to the mailgun API
type ListOptions struct {
	Limit int
}

func (mg *MailgunImpl) ListMembers(address string, opts *ListOptions) *MemberListIterator {
	r := newHTTPRequest(generateMemberApiUrl(mg, listsEndpoint, address) + "/pages")
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	if opts != nil {
		if opts.Limit != 0 {
			r.addParameter("limit", strconv.Itoa(opts.Limit))
		}
	}
	url, err := r.generateUrlWithParameters()
	return &MemberListIterator{
		mg:                 mg,
		memberListResponse: memberListResponse{Paging: Paging{Next: url, First: url}},
		err:                err,
	}
}
<commit_msg>fix member decoding<commit_after>package mailgun

import (
	"context"
	"encoding/json"
	"strconv"
)

// yes and no are variables which provide us the ability to take their addresses.
// Subscribed and Unsubscribed are pointers to these booleans.
//
// We use a pointer to boolean as a kind of trinary data type:
// if nil, the relevant data type remains unspecified.
// Otherwise, its value is either true or false.
var (
	yes bool = true
	no  bool = false
)

// Mailing list members have an attribute that determines if they've subscribed to the mailing list or not.
// This attribute may be used to filter the results returned by GetSubscribers().
// All, Subscribed, and Unsubscribed provides a convenient and readable syntax for specifying the scope of the search.
var (
	All          *bool = nil
	Subscribed   *bool = &yes
	Unsubscribed *bool = &no
)

// A Member structure represents a member of the mailing list.
// The Vars field can represent any JSON-encodable data.
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"`
}

type memberListResponse struct {
	Lists  []Member `json:"items"`
	Paging Paging   `json:"paging"`
}

type memberResponse struct {
	Member Member `json:"member"`
}

type MemberListIterator struct {
	memberListResponse
	mg  Mailgun
	err error
}

// Used by List methods to specify what list parameters to send to the mailgun API
type ListOptions struct {
	Limit int
}

func (mg *MailgunImpl) ListMembers(address string, opts *ListOptions) *MemberListIterator {
	r := newHTTPRequest(generateMemberApiUrl(mg, listsEndpoint, address) + "/pages")
	r.setClient(mg.Client())
	r.setBasicAuth(basicAuthUser, mg.APIKey())
	if opts != nil {
		if opts.Limit != 0 {
			r.addParameter("limit", strconv.Itoa(opts.Limit))
		}
	}
	url, err := r.generateUrlWithParameters()
	return &MemberListIterator{
		mg:                 mg,
		memberListResponse: memberListResponse{Paging: Paging{Next: url, First: url}},
		err:                err,
	}
}

{'fraction_non_alphanumeric': 0.0928406466512702, 'fraction_numerical': 0.00046189376443418013, 'mean_word_length': 3.4511819116135665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2670885', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1240, 'n_words': 472}