Repository: mailgun/mailgun-go
Pull request #396 (2025-03-01 13:50:34)

DE-1146 github.com/mailgun/mailgun-go/v5


Patch:
diff --git a/analytics.go b/analytics.go
index a82825f..e6e28c9 100644
--- a/analytics.go
+++ b/analytics.go
@@ -4,7 +4,7 @@ import (
 	"context"
 
 	"github.com/mailgun/errors"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 type MetricsOptions = mtypes.MetricsRequest
@@ -20,7 +20,7 @@ type MetricsOptions = mtypes.MetricsRequest
 //	}}
 //
 // https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Metrics/
-func (mg *MailgunImpl) ListMetrics(opts MetricsOptions) (*MetricsIterator, error) {
+func (mg *Client) ListMetrics(opts MetricsOptions) (*MetricsIterator, error) {
 	if opts.Pagination.Limit == 0 {
 		opts.Pagination.Limit = 10
 	}
diff --git a/bounces.go b/bounces.go
index c83ed1d..b829697 100644
--- a/bounces.go
+++ b/bounces.go
@@ -4,14 +4,14 @@ import (
 	"context"
 	"strconv"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // ListBounces returns a complete set of bounces logged against the sender's domain, if any.
 // The results include the total number of bounces (regardless of skip or limit settings),
 // and the slice of bounces specified, if successful.
 // Note that the length of the slice may be smaller than the total number of bounces.
-func (mg *MailgunImpl) ListBounces(domain string, opts *ListOptions) *BouncesIterator {
+func (mg *Client) ListBounces(domain string, opts *ListOptions) *BouncesIterator {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, bouncesEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -123,7 +123,7 @@ func (ci *BouncesIterator) fetch(ctx context.Context, url string) error {
 }
 
 // GetBounce retrieves a single bounce record, if any exist, for the given recipient address.
-func (mg *MailgunImpl) GetBounce(ctx context.Context, domain, address string) (mtypes.Bounce, error) {
+func (mg *Client) GetBounce(ctx context.Context, domain, address string) (mtypes.Bounce, error) {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, bouncesEndpoint, domain) + "/" + address)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -149,7 +149,7 @@ func (mg *MailgunImpl) GetBounce(ctx context.Context, domain, address string) (m
 //
 // Note that both code and error exist as strings, even though
 // code will report as a number.
-func (mg *MailgunImpl) AddBounce(ctx context.Context, domain, address, code, bounceError string) error {
+func (mg *Client) AddBounce(ctx context.Context, domain, address, code, bounceError string) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, bouncesEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -167,7 +167,7 @@ func (mg *MailgunImpl) AddBounce(ctx context.Context, domain, address, code, bou
 }
 
 // Add Bounces adds a list of bounces to the bounce list
-func (mg *MailgunImpl) AddBounces(ctx context.Context, domain string, bounces []mtypes.Bounce) error {
+func (mg *Client) AddBounces(ctx context.Context, domain string, bounces []mtypes.Bounce) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, bouncesEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -179,7 +179,7 @@ func (mg *MailgunImpl) AddBounces(ctx context.Context, domain string, bounces []
 }
 
 // DeleteBounce removes all bounces associted with the provided e-mail address.
-func (mg *MailgunImpl) DeleteBounce(ctx context.Context, domain, address string) error {
+func (mg *Client) DeleteBounce(ctx context.Context, domain, address string) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, bouncesEndpoint, domain) + "/" + address)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -188,7 +188,7 @@ func (mg *MailgunImpl) DeleteBounce(ctx context.Context, domain, address string)
 }
 
 // DeleteBounceList removes all bounces in the bounce list
-func (mg *MailgunImpl) DeleteBounceList(ctx context.Context, domain string) error {
+func (mg *Client) DeleteBounceList(ctx context.Context, domain string) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, bouncesEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/credentials.go b/credentials.go
index 88f35c6..829f862 100644
--- a/credentials.go
+++ b/credentials.go
@@ -5,14 +5,14 @@ import (
 	"errors"
 	"strconv"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // ErrEmptyParam is returned when a required parameter is missing.
 var ErrEmptyParam = errors.New("empty or illegal parameter")
 
 // ListCredentials returns the (possibly zero-length) list of credentials associated with your domain.
-func (mg *MailgunImpl) ListCredentials(domain string, opts *ListOptions) *CredentialsIterator {
+func (mg *Client) ListCredentials(domain string, opts *ListOptions) *CredentialsIterator {
 	var limit int
 	if opts != nil {
 		limit = opts.Limit
@@ -163,7 +163,7 @@ func (ri *CredentialsIterator) fetch(ctx context.Context, skip, limit int) error
 }
 
 // CreateCredential attempts to create associate a new principle with your domain.
-func (mg *MailgunImpl) CreateCredential(ctx context.Context, domain, login, password string) error {
+func (mg *Client) CreateCredential(ctx context.Context, domain, login, password string) error {
 	if (login == "") || (password == "") {
 		return ErrEmptyParam
 	}
@@ -178,7 +178,7 @@ func (mg *MailgunImpl) CreateCredential(ctx context.Context, domain, login, pass
 }
 
 // ChangeCredentialPassword attempts to alter the indicated credential's password.
-func (mg *MailgunImpl) ChangeCredentialPassword(ctx context.Context, domain, login, password string) error {
+func (mg *Client) ChangeCredentialPassword(ctx context.Context, domain, login, password string) error {
 	if (login == "") || (password == "") {
 		return ErrEmptyParam
 	}
@@ -192,7 +192,7 @@ func (mg *MailgunImpl) ChangeCredentialPassword(ctx context.Context, domain, log
 }
 
 // DeleteCredential attempts to remove the indicated principle from the domain.
-func (mg *MailgunImpl) DeleteCredential(ctx context.Context, domain, login string) error {
+func (mg *Client) DeleteCredential(ctx context.Context, domain, login string) error {
 	if login == "" {
 		return ErrEmptyParam
 	}
diff --git a/domain_keys.go b/domain_keys.go
index 71930b0..313d116 100644
--- a/domain_keys.go
+++ b/domain_keys.go
@@ -5,7 +5,7 @@ import (
 )
 
 // UpdateDomainDkimSelector updates the DKIM selector for a domain
-func (mg *MailgunImpl) UpdateDomainDkimSelector(ctx context.Context, domain, dkimSelector string) error {
+func (mg *Client) UpdateDomainDkimSelector(ctx context.Context, domain, dkimSelector string) error {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + domain + "/dkim_selector")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/domains.go b/domains.go
index 142565b..5071967 100644
--- a/domains.go
+++ b/domains.go
@@ -5,7 +5,7 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 type ListDomainsOptions struct {
@@ -13,7 +13,7 @@ type ListDomainsOptions struct {
 }
 
 // ListDomains retrieves a set of domains from Mailgun.
-func (mg *MailgunImpl) ListDomains(opts *ListDomainsOptions) *DomainsIterator {
+func (mg *Client) ListDomains(opts *ListDomainsOptions) *DomainsIterator {
 	var limit int
 	if opts != nil {
 		limit = opts.Limit
@@ -166,7 +166,7 @@ func (ri *DomainsIterator) fetch(ctx context.Context, skip, limit int) error {
 type GetDomainOptions struct{}
 
 // GetDomain retrieves detailed information about the named domain.
-func (mg *MailgunImpl) GetDomain(ctx context.Context, domain string, _ *GetDomainOptions) (mtypes.GetDomainResponse, error) {
+func (mg *Client) GetDomain(ctx context.Context, domain string, _ *GetDomainOptions) (mtypes.GetDomainResponse, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 4, domainsEndpoint) + "/" + domain)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -175,7 +175,7 @@ func (mg *MailgunImpl) GetDomain(ctx context.Context, domain string, _ *GetDomai
 	return resp, err
 }
 
-func (mg *MailgunImpl) VerifyDomain(ctx context.Context, domain string) (mtypes.GetDomainResponse, error) {
+func (mg *Client) VerifyDomain(ctx context.Context, domain string) (mtypes.GetDomainResponse, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 4, domainsEndpoint) + "/" + domain + "/verify")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -205,7 +205,7 @@ type CreateDomainOptions struct {
 // The spamAction domain must be one of Delete, Tag, or Disabled.
 // The wildcard parameter instructs Mailgun to treat all subdomains of this domain uniformly if true,
 // and as different domains if false.
-func (mg *MailgunImpl) CreateDomain(ctx context.Context, name string, opts *CreateDomainOptions) (mtypes.GetDomainResponse, error) {
+func (mg *Client) CreateDomain(ctx context.Context, name string, opts *CreateDomainOptions) (mtypes.GetDomainResponse, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 4, domainsEndpoint))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -242,7 +242,7 @@ func (mg *MailgunImpl) CreateDomain(ctx context.Context, name string, opts *Crea
 }
 
 // DeleteDomain instructs Mailgun to dispose of the named domain name
-func (mg *MailgunImpl) DeleteDomain(ctx context.Context, name string) error {
+func (mg *Client) DeleteDomain(ctx context.Context, name string) error {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + name)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -258,7 +258,7 @@ type UpdateDomainOptions struct {
 
 // UpdateDomain updates a domain's attributes.
 // Currently only the web_scheme update is supported, spam_action and wildcard are to be added.
-func (mg *MailgunImpl) UpdateDomain(ctx context.Context, name string, opts *UpdateDomainOptions) error {
+func (mg *Client) UpdateDomain(ctx context.Context, name string, opts *UpdateDomainOptions) error {
 	r := newHTTPRequest(generateApiUrl(mg, 4, domainsEndpoint) + "/" + name)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/domains_connection.go b/domains_connection.go
index efca21c..eb61c27 100644
--- a/domains_connection.go
+++ b/domains_connection.go
@@ -3,11 +3,11 @@ package mailgun
 import (
 	"context"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // GetDomainConnection returns delivery connection settings for the defined domain
-func (mg *MailgunImpl) GetDomainConnection(ctx context.Context, domain string) (mtypes.DomainConnection, error) {
+func (mg *Client) GetDomainConnection(ctx context.Context, domain string) (mtypes.DomainConnection, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + domain + "/connection")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -17,7 +17,7 @@ func (mg *MailgunImpl) GetDomainConnection(ctx context.Context, domain string) (
 }
 
 // UpdateDomainConnection updates the specified delivery connection settings for the defined domain
-func (mg *MailgunImpl) UpdateDomainConnection(ctx context.Context, domain string, settings mtypes.DomainConnection) error {
+func (mg *Client) UpdateDomainConnection(ctx context.Context, domain string, settings mtypes.DomainConnection) error {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + domain + "/connection")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/domains_tracking.go b/domains_tracking.go
index 3be52c8..9541a73 100644
--- a/domains_tracking.go
+++ b/domains_tracking.go
@@ -3,11 +3,11 @@ package mailgun
 import (
 	"context"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // GetDomainTracking returns tracking settings for a domain
-func (mg *MailgunImpl) GetDomainTracking(ctx context.Context, domain string) (mtypes.DomainTracking, error) {
+func (mg *Client) GetDomainTracking(ctx context.Context, domain string) (mtypes.DomainTracking, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + domain + "/tracking")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -16,7 +16,7 @@ func (mg *MailgunImpl) GetDomainTracking(ctx context.Context, domain string) (mt
 	return resp.Tracking, err
 }
 
-func (mg *MailgunImpl) UpdateClickTracking(ctx context.Context, domain, active string) error {
+func (mg *Client) UpdateClickTracking(ctx context.Context, domain, active string) error {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + domain + "/tracking/click")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -27,7 +27,7 @@ func (mg *MailgunImpl) UpdateClickTracking(ctx context.Context, domain, active s
 	return err
 }
 
-func (mg *MailgunImpl) UpdateUnsubscribeTracking(ctx context.Context, domain, active, htmlFooter, textFooter string) error {
+func (mg *Client) UpdateUnsubscribeTracking(ctx context.Context, domain, active, htmlFooter, textFooter string) error {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + domain + "/tracking/unsubscribe")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -40,7 +40,7 @@ func (mg *MailgunImpl) UpdateUnsubscribeTracking(ctx context.Context, domain, ac
 	return err
 }
 
-func (mg *MailgunImpl) UpdateOpenTracking(ctx context.Context, domain, active string) error {
+func (mg *Client) UpdateOpenTracking(ctx context.Context, domain, active string) error {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + domain + "/tracking/open")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/events.go b/events.go
index 192c4ff..ee17f7a 100644
--- a/events.go
+++ b/events.go
@@ -7,7 +7,7 @@ import (
 	"time"
 
 	jsoniter "github.com/json-iterator/go"
-	"github.com/mailgun/mailgun-go/v4/events"
+	"github.com/mailgun/mailgun-go/v5/events"
 )
 
 // ListEventOptions modifies the behavior of ListEvents()
@@ -37,12 +37,12 @@ type EventIterator struct {
 }
 
 // ListEvents creates a new iterator to fetch a page of events from the events api
-func (mg *MailgunImpl) ListEvents(domain string, opts *ListEventOptions) *EventIterator {
+func (mg *Client) ListEvents(domain string, opts *ListEventOptions) *EventIterator {
 	url := generateApiV3UrlWithDomain(mg, eventsEndpoint, domain)
 	return mg.listEvents(url, opts)
 }
 
-func (mg *MailgunImpl) listEvents(url string, opts *ListEventOptions) *EventIterator {
+func (mg *Client) listEvents(url string, opts *ListEventOptions) *EventIterator {
 	req := newHTTPRequest(url)
 	if opts != nil {
 		if opts.Limit > 0 {
@@ -199,7 +199,7 @@ type EventPoller struct {
 //	if it.Err() != nil {
 //		log.Fatal(it.Err())
 //	}
-func (mg *MailgunImpl) PollEvents(domain string, opts *ListEventOptions) *EventPoller {
+func (mg *Client) PollEvents(domain string, opts *ListEventOptions) *EventPoller {
 	now := time.Now()
 	// ForceAscending must be set
 	opts.ForceAscending = true
diff --git a/examples/examples.go b/examples/examples.go
index dcf82fe..bac559d 100644
--- a/examples/examples.go
+++ b/examples/examples.go
@@ -6,9 +6,9 @@ import (
 	"os"
 	"time"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/events"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/events"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func AddBounce(domain, apiKey string) error {
diff --git a/exports.go b/exports.go
index 88d3e78..e79185d 100644
--- a/exports.go
+++ b/exports.go
@@ -6,11 +6,11 @@ import (
 	"fmt"
 	"net/http"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // CreateExport creates an export based on the URL given
-func (mg *MailgunImpl) CreateExport(ctx context.Context, url string) error {
+func (mg *Client) CreateExport(ctx context.Context, url string) error {
 	r := newHTTPRequest(generateApiUrl(mg, 3, exportsEndpoint))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -22,7 +22,7 @@ func (mg *MailgunImpl) CreateExport(ctx context.Context, url string) error {
 }
 
 // ListExports lists all exports created within the past 24 hours
-func (mg *MailgunImpl) ListExports(ctx context.Context, url string) ([]mtypes.Export, error) {
+func (mg *Client) ListExports(ctx context.Context, url string) ([]mtypes.Export, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, exportsEndpoint))
 	r.setClient(mg.HTTPClient())
 	if url != "" {
@@ -43,7 +43,7 @@ func (mg *MailgunImpl) ListExports(ctx context.Context, url string) ([]mtypes.Ex
 }
 
 // GetExport gets an export by id
-func (mg *MailgunImpl) GetExport(ctx context.Context, id string) (mtypes.Export, error) {
+func (mg *Client) GetExport(ctx context.Context, id string) (mtypes.Export, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, exportsEndpoint) + "/" + id)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -54,7 +54,7 @@ func (mg *MailgunImpl) GetExport(ctx context.Context, id string) (mtypes.Export,
 
 // Download an export by ID. This will respond with a '302 Moved'
 // with the Location header of temporary S3 URL if it is available.
-func (mg *MailgunImpl) GetExportLink(ctx context.Context, id string) (string, error) {
+func (mg *Client) GetExportLink(ctx context.Context, id string) (string, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, exportsEndpoint) + "/" + id + "/download_url")
 	c := mg.HTTPClient()
 
diff --git a/go.mod b/go.mod
index 32b49f8..6986919 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/mailgun/mailgun-go/v4
+module github.com/mailgun/mailgun-go/v5
 
 go 1.22
 
diff --git a/ips.go b/ips.go
index 901f6e8..e159c34 100644
--- a/ips.go
+++ b/ips.go
@@ -3,11 +3,11 @@ package mailgun
 import (
 	"context"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // ListIPS returns a list of IPs assigned to your account
-func (mg *MailgunImpl) ListIPS(ctx context.Context, dedicated bool) ([]mtypes.IPAddress, error) {
+func (mg *Client) ListIPS(ctx context.Context, dedicated bool) ([]mtypes.IPAddress, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, ipsEndpoint))
 	r.setClient(mg.HTTPClient())
 	if dedicated {
@@ -27,7 +27,7 @@ func (mg *MailgunImpl) ListIPS(ctx context.Context, dedicated bool) ([]mtypes.IP
 }
 
 // GetIP returns information about the specified IP
-func (mg *MailgunImpl) GetIP(ctx context.Context, ip string) (mtypes.IPAddress, error) {
+func (mg *Client) GetIP(ctx context.Context, ip string) (mtypes.IPAddress, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, ipsEndpoint) + "/" + ip)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -37,7 +37,7 @@ func (mg *MailgunImpl) GetIP(ctx context.Context, ip string) (mtypes.IPAddress,
 }
 
 // ListDomainIPS returns a list of IPs currently assigned to the specified domain.
-func (mg *MailgunImpl) ListDomainIPS(ctx context.Context, domain string) ([]mtypes.IPAddress, error) {
+func (mg *Client) ListDomainIPS(ctx context.Context, domain string) ([]mtypes.IPAddress, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + domain + "/ips")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -54,7 +54,7 @@ func (mg *MailgunImpl) ListDomainIPS(ctx context.Context, domain string) ([]mtyp
 }
 
 // Assign a dedicated IP to the domain specified.
-func (mg *MailgunImpl) AddDomainIP(ctx context.Context, domain, ip string) error {
+func (mg *Client) AddDomainIP(ctx context.Context, domain, ip string) error {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + domain + "/ips")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -66,7 +66,7 @@ func (mg *MailgunImpl) AddDomainIP(ctx context.Context, domain, ip string) error
 }
 
 // Unassign an IP from the domain specified.
-func (mg *MailgunImpl) DeleteDomainIP(ctx context.Context, domain, ip string) error {
+func (mg *Client) DeleteDomainIP(ctx context.Context, domain, ip string) error {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + domain + "/ips/" + ip)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/limits.go b/limits.go
index bcb30c7..a081e78 100644
--- a/limits.go
+++ b/limits.go
@@ -3,11 +3,11 @@ package mailgun
 import (
 	"context"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // GetTagLimits returns tracking settings for a domain
-func (mg *MailgunImpl) GetTagLimits(ctx context.Context, domain string) (mtypes.TagLimits, error) {
+func (mg *Client) GetTagLimits(ctx context.Context, domain string) (mtypes.TagLimits, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, domainsEndpoint) + "/" + domain + "/limits/tag")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/mailgun.go b/mailgun.go
index 36afe09..78c9cdf 100644
--- a/mailgun.go
+++ b/mailgun.go
@@ -83,7 +83,7 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // Debug set true to write the HTTP requests in curl for to stdout
@@ -253,9 +253,8 @@ type Mailgun interface {
 	RemoveOnBehalfOfSubaccount()
 }
 
-// MailgunImpl bundles data needed by a large number of methods in order to interact with the Mailgun API.
-// Colloquially, we refer to instances of this structure as "clients."
-type MailgunImpl struct {
+// Client bundles data needed by a large number of methods in order to interact with the Mailgun API.
+type Client struct {
 	apiBase           string
 	apiKey            string
 	webhookSigningKey string
@@ -264,8 +263,8 @@ type MailgunImpl struct {
 }
 
 // NewMailgun creates a new client instance.
-func NewMailgun(apiKey string) *MailgunImpl {
-	return &MailgunImpl{
+func NewMailgun(apiKey string) *Client {
+	return &Client{
 		apiBase: APIBase,
 		apiKey:  apiKey,
 		client:  http.DefaultClient,
@@ -274,7 +273,7 @@ func NewMailgun(apiKey string) *MailgunImpl {
 
 // NewMailgunFromEnv returns a new Mailgun client using the environment variables
 // MG_API_KEY, MG_URL, and MG_WEBHOOK_SIGNING_KEY
-func NewMailgunFromEnv() (*MailgunImpl, error) {
+func NewMailgunFromEnv() (*Client, error) {
 	apiKey := os.Getenv("MG_API_KEY")
 	if apiKey == "" {
 		return nil, errors.New("required environment variable MG_API_KEY not defined")
@@ -299,43 +298,43 @@ func NewMailgunFromEnv() (*MailgunImpl, error) {
 }
 
 // APIBase returns the API Base URL configured for this client.
-func (mg *MailgunImpl) APIBase() string {
+func (mg *Client) APIBase() string {
 	return mg.apiBase
 }
 
 // APIKey returns the API key configured for this client.
-func (mg *MailgunImpl) APIKey() string {
+func (mg *Client) APIKey() string {
 	return mg.apiKey
 }
 
 // HTTPClient returns the HTTP client configured for this client.
-func (mg *MailgunImpl) HTTPClient() *http.Client {
+func (mg *Client) HTTPClient() *http.Client {
 	return mg.client
 }
 
 // SetHTTPClient updates the HTTP client for this client.
-func (mg *MailgunImpl) SetHTTPClient(c *http.Client) {
+func (mg *Client) SetHTTPClient(c *http.Client) {
 	mg.client = c
 }
 
 // WebhookSigningKey returns the webhook signing key configured for this client
-func (mg *MailgunImpl) WebhookSigningKey() string {
+func (mg *Client) WebhookSigningKey() string {
 	return mg.webhookSigningKey
 }
 
 // SetWebhookSigningKey updates the webhook signing key for this client
-func (mg *MailgunImpl) SetWebhookSigningKey(webhookSigningKey string) {
+func (mg *Client) SetWebhookSigningKey(webhookSigningKey string) {
 	mg.webhookSigningKey = webhookSigningKey
 }
 
 // SetOnBehalfOfSubaccount sets X-Mailgun-On-Behalf-Of header to SUBACCOUNT_ACCOUNT_ID in order to perform API request
 // on behalf of subaccount.
-func (mg *MailgunImpl) SetOnBehalfOfSubaccount(subaccountId string) {
+func (mg *Client) SetOnBehalfOfSubaccount(subaccountId string) {
 	mg.AddOverrideHeader(OnBehalfOfHeader, subaccountId)
 }
 
 // RemoveOnBehalfOfSubaccount remove X-Mailgun-On-Behalf-Of header for primary usage.
-func (mg *MailgunImpl) RemoveOnBehalfOfSubaccount() {
+func (mg *Client) RemoveOnBehalfOfSubaccount() {
 	delete(mg.overrideHeaders, OnBehalfOfHeader)
 }
 
@@ -349,7 +348,7 @@ func (mg *MailgunImpl) RemoveOnBehalfOfSubaccount() {
 //
 //	// Set a custom base API
 //	mg.SetAPIBase("https://localhost")
-func (mg *MailgunImpl) SetAPIBase(address string) error {
+func (mg *Client) SetAPIBase(address string) error {
 	if invalidURL.MatchString(address) {
 		return errors.New(`APIBase must not contain a version; SetAPIBase("https://host")`)
 	}
@@ -360,7 +359,7 @@ func (mg *MailgunImpl) SetAPIBase(address string) error {
 
 // AddOverrideHeader allows the user to specify additional headers that will be included in the HTTP request
 // This is mostly useful for testing the Mailgun API hosted at a different endpoint.
-func (mg *MailgunImpl) AddOverrideHeader(k, v string) {
+func (mg *Client) AddOverrideHeader(k, v string) {
 	if mg.overrideHeaders == nil {
 		mg.overrideHeaders = make(map[string]string)
 	}
diff --git a/mailing_lists.go b/mailing_lists.go
index 10a7aee..e6838ba 100644
--- a/mailing_lists.go
+++ b/mailing_lists.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"strconv"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 type ListsIterator struct {
@@ -14,7 +14,7 @@ type ListsIterator struct {
 }
 
 // ListMailingLists returns the specified set of mailing lists administered by your account.
-func (mg *MailgunImpl) ListMailingLists(opts *ListOptions) *ListsIterator {
+func (mg *Client) ListMailingLists(opts *ListOptions) *ListsIterator {
 	r := newHTTPRequest(generateApiUrl(mg, 3, listsEndpoint) + "/pages")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -125,7 +125,7 @@ func (li *ListsIterator) fetch(ctx context.Context, url string) error {
 // If unspecified, Description remains blank,
 // while AccessLevel defaults to Everyone
 // and ReplyPreference defaults to List.
-func (mg *MailgunImpl) CreateMailingList(ctx context.Context, prototype mtypes.MailingList) (mtypes.MailingList, error) {
+func (mg *Client) CreateMailingList(ctx context.Context, prototype mtypes.MailingList) (mtypes.MailingList, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, listsEndpoint))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -156,7 +156,7 @@ func (mg *MailgunImpl) CreateMailingList(ctx context.Context, prototype mtypes.M
 
 // DeleteMailingList removes all current members of the list, then removes the list itself.
 // Attempts to send e-mail to the list will fail subsequent to this call.
-func (mg *MailgunImpl) DeleteMailingList(ctx context.Context, addr string) error {
+func (mg *Client) DeleteMailingList(ctx context.Context, addr string) error {
 	r := newHTTPRequest(generateApiUrl(mg, 3, listsEndpoint) + "/" + addr)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -166,7 +166,7 @@ func (mg *MailgunImpl) DeleteMailingList(ctx context.Context, addr string) error
 
 // GetMailingList allows your application to recover the complete List structure
 // representing a mailing list, so long as you have its e-mail address.
-func (mg *MailgunImpl) GetMailingList(ctx context.Context, addr string) (mtypes.MailingList, error) {
+func (mg *Client) GetMailingList(ctx context.Context, addr string) (mtypes.MailingList, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, listsEndpoint) + "/" + addr)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -187,7 +187,7 @@ func (mg *MailgunImpl) GetMailingList(ctx context.Context, addr string) (mtypes.
 // Be careful!  If changing the address of a mailing list,
 // e-mail sent to the old address will not succeed.
 // Make sure you account for the change accordingly.
-func (mg *MailgunImpl) UpdateMailingList(ctx context.Context, addr string, prototype mtypes.MailingList) (mtypes.MailingList, error) {
+func (mg *Client) UpdateMailingList(ctx context.Context, addr string, prototype mtypes.MailingList) (mtypes.MailingList, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, listsEndpoint) + "/" + addr)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/members.go b/members.go
index 747fb41..44b1565 100644
--- a/members.go
+++ b/members.go
@@ -5,7 +5,7 @@ import (
 	"encoding/json"
 	"strconv"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 type MemberListIterator struct {
@@ -14,7 +14,7 @@ type MemberListIterator struct {
 	err error
 }
 
-func (mg *MailgunImpl) ListMembers(address string, opts *ListOptions) *MemberListIterator {
+func (mg *Client) ListMembers(address string, opts *ListOptions) *MemberListIterator {
 	r := newHTTPRequest(generateMemberApiUrl(mg, listsEndpoint, address) + "/pages")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -113,7 +113,7 @@ func (li *MemberListIterator) fetch(ctx context.Context, url string) error {
 
 // GetMember returns a complete Member structure for a member of a mailing list,
 // given only their subscription e-mail address.
-func (mg *MailgunImpl) GetMember(ctx context.Context, s, l string) (mtypes.Member, error) {
+func (mg *Client) GetMember(ctx context.Context, s, l string) (mtypes.Member, error) {
 	r := newHTTPRequest(generateMemberApiUrl(mg, listsEndpoint, l) + "/" + s)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -129,7 +129,7 @@ func (mg *MailgunImpl) GetMember(ctx context.Context, s, l string) (mtypes.Membe
 // CreateMember registers a new member of the indicated mailing list.
 // If merge is set to true, then the registration may update an existing Member's settings.
 // Otherwise, an error will occur if you attempt to add a member with a duplicate e-mail address.
-func (mg *MailgunImpl) CreateMember(ctx context.Context, merge bool, addr string, prototype mtypes.Member) error {
+func (mg *Client) CreateMember(ctx context.Context, merge bool, addr string, prototype mtypes.Member) error {
 	vs, err := json.Marshal(prototype.Vars)
 	if err != nil {
 		return err
@@ -152,7 +152,7 @@ func (mg *MailgunImpl) CreateMember(ctx context.Context, merge bool, addr string
 
 // UpdateMember lets you change certain details about the indicated mailing list member.
 // Address, Name, Vars, and Subscribed fields may be changed.
-func (mg *MailgunImpl) UpdateMember(ctx context.Context, s, l string, prototype mtypes.Member) (mtypes.Member, error) {
+func (mg *Client) UpdateMember(ctx context.Context, s, l string, prototype mtypes.Member) (mtypes.Member, error) {
 	r := newHTTPRequest(generateMemberApiUrl(mg, listsEndpoint, l) + "/" + s)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -185,7 +185,7 @@ func (mg *MailgunImpl) UpdateMember(ctx context.Context, s, l string, prototype
 }
 
 // DeleteMember removes the member from the list.
-func (mg *MailgunImpl) DeleteMember(ctx context.Context, member, addr string) error {
+func (mg *Client) DeleteMember(ctx context.Context, member, addr string) error {
 	r := newHTTPRequest(generateMemberApiUrl(mg, listsEndpoint, addr) + "/" + member)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -202,7 +202,7 @@ func (mg *MailgunImpl) DeleteMember(ctx context.Context, member, addr string) er
 // If a simple slice of strings is passed, each string refers to the member's e-mail address.
 // Otherwise, each Member needs to have at least the Address field filled out.
 // Other fields are optional, but may be set according to your needs.
-func (mg *MailgunImpl) CreateMemberList(ctx context.Context, u *bool, addr string, newMembers []any) error {
+func (mg *Client) CreateMemberList(ctx context.Context, u *bool, addr string, newMembers []any) error {
 	r := newHTTPRequest(generateMemberApiUrl(mg, listsEndpoint, addr) + ".json")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/messages.go b/messages.go
index 8efbb0e..843c458 100644
--- a/messages.go
+++ b/messages.go
@@ -649,7 +649,7 @@ type SendableMessage interface {
 //	}
 //
 // See the public mailgun documentation for all possible return codes and error messages
-func (mg *MailgunImpl) Send(ctx context.Context, m SendableMessage) (mes, id string, err error) {
+func (mg *Client) Send(ctx context.Context, m SendableMessage) (mes, id string, err error) {
 	if m.Domain() == "" {
 		err = errors.New("you must provide a valid domain before calling Send()")
 		return "", "", err
diff --git a/mocks/mock.go b/mocks/mock.go
index d0c5697..62a499a 100644
--- a/mocks/mock.go
+++ b/mocks/mock.go
@@ -13,8 +13,8 @@ import (
 	"sync"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/events"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/events"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // Server is a Mailgun API mock suitable for testing
diff --git a/mocks/mock_analytics.go b/mocks/mock_analytics.go
index 8ea0e1a..8bcce2b 100644
--- a/mocks/mock_analytics.go
+++ b/mocks/mock_analytics.go
@@ -4,7 +4,7 @@ import (
 	"net/http"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 const metricsEndpoint = "analytics/metrics"
diff --git a/mocks/mock_bounces.go b/mocks/mock_bounces.go
index f2ccdb9..7d57cd8 100644
--- a/mocks/mock_bounces.go
+++ b/mocks/mock_bounces.go
@@ -9,7 +9,7 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addBouncesRoutes(r chi.Router) {
diff --git a/mocks/mock_complaints.go b/mocks/mock_complaints.go
index aab25cd..0244427 100644
--- a/mocks/mock_complaints.go
+++ b/mocks/mock_complaints.go
@@ -9,7 +9,7 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addComplaintsRoutes(r chi.Router) {
diff --git a/mocks/mock_credentials.go b/mocks/mock_credentials.go
index 1c4794a..9884559 100644
--- a/mocks/mock_credentials.go
+++ b/mocks/mock_credentials.go
@@ -5,7 +5,7 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addCredentialsRoutes(r chi.Router) {
diff --git a/mocks/mock_domains.go b/mocks/mock_domains.go
index 3c268f6..b6e3ff1 100644
--- a/mocks/mock_domains.go
+++ b/mocks/mock_domains.go
@@ -5,7 +5,7 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 type DomainContainer struct {
diff --git a/mocks/mock_events.go b/mocks/mock_events.go
index a65ae0f..108bd14 100644
--- a/mocks/mock_events.go
+++ b/mocks/mock_events.go
@@ -6,9 +6,9 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/events"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/events"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addEventRoutes(r chi.Router) {
diff --git a/mocks/mock_exports.go b/mocks/mock_exports.go
index ddef635..29e10f7 100644
--- a/mocks/mock_exports.go
+++ b/mocks/mock_exports.go
@@ -5,7 +5,7 @@ import (
 	"strconv"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addExportRoutes(r chi.Router) {
diff --git a/mocks/mock_ips.go b/mocks/mock_ips.go
index 1ed32c5..20707cd 100644
--- a/mocks/mock_ips.go
+++ b/mocks/mock_ips.go
@@ -4,7 +4,7 @@ import (
 	"net/http"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addIPRoutes(r chi.Router) {
diff --git a/mocks/mock_mailing_list.go b/mocks/mock_mailing_list.go
index 2f37d0d..8a7fbd7 100644
--- a/mocks/mock_mailing_list.go
+++ b/mocks/mock_mailing_list.go
@@ -7,7 +7,7 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 type MailingListContainer struct {
diff --git a/mocks/mock_messages.go b/mocks/mock_messages.go
index 0637f6b..e590e7b 100644
--- a/mocks/mock_messages.go
+++ b/mocks/mock_messages.go
@@ -7,9 +7,9 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/events"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/events"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addMessagesRoutes(r chi.Router) {
diff --git a/mocks/mock_routes.go b/mocks/mock_routes.go
index dc5c7ca..79d7fd2 100644
--- a/mocks/mock_routes.go
+++ b/mocks/mock_routes.go
@@ -6,7 +6,7 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 type routeResponse struct {
diff --git a/mocks/mock_subaccounts.go b/mocks/mock_subaccounts.go
index f5f5f38..69012a2 100644
--- a/mocks/mock_subaccounts.go
+++ b/mocks/mock_subaccounts.go
@@ -4,7 +4,7 @@ import (
 	"net/http"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addSubaccountRoutes(r chi.Router) {
diff --git a/mocks/mock_tags.go b/mocks/mock_tags.go
index 1068e84..d0a4383 100644
--- a/mocks/mock_tags.go
+++ b/mocks/mock_tags.go
@@ -6,7 +6,7 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addTagsRoutes(r chi.Router) {
diff --git a/mocks/mock_template_versions.go b/mocks/mock_template_versions.go
index f555f2d..b555e69 100644
--- a/mocks/mock_template_versions.go
+++ b/mocks/mock_template_versions.go
@@ -8,7 +8,7 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addTemplateVersionRoutes(r chi.Router) {
diff --git a/mocks/mock_templates.go b/mocks/mock_templates.go
index 61f10a2..18d4926 100644
--- a/mocks/mock_templates.go
+++ b/mocks/mock_templates.go
@@ -8,7 +8,7 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addTemplateRoutes(r chi.Router) {
diff --git a/mocks/mock_unsubscribes.go b/mocks/mock_unsubscribes.go
index 4f7ee9a..0427d19 100644
--- a/mocks/mock_unsubscribes.go
+++ b/mocks/mock_unsubscribes.go
@@ -9,7 +9,7 @@ import (
 	"time"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addUnsubscribesRoutes(r chi.Router) {
diff --git a/mocks/mock_validation.go b/mocks/mock_validation.go
index 9e34108..0ff6519 100644
--- a/mocks/mock_validation.go
+++ b/mocks/mock_validation.go
@@ -5,7 +5,7 @@ import (
 	"net/mail"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addValidationRoutes(r chi.Router) {
diff --git a/mocks/mock_webhooks.go b/mocks/mock_webhooks.go
index 37c1265..82e69a0 100644
--- a/mocks/mock_webhooks.go
+++ b/mocks/mock_webhooks.go
@@ -4,7 +4,7 @@ import (
 	"net/http"
 
 	"github.com/go-chi/chi/v5"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 func (ms *Server) addWebhookRoutes(r chi.Router) {
diff --git a/mtypes/webhooks.go b/mtypes/webhooks.go
index d1c7642..02fdab4 100644
--- a/mtypes/webhooks.go
+++ b/mtypes/webhooks.go
@@ -1,7 +1,7 @@
 package mtypes
 
 import (
-	"github.com/mailgun/mailgun-go/v4/events"
+	"github.com/mailgun/mailgun-go/v5/events"
 )
 
 type UrlOrUrls struct {
diff --git a/routes.go b/routes.go
index 677eb23..c393968 100644
--- a/routes.go
+++ b/routes.go
@@ -7,7 +7,7 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // ForwardedMessage represents the payload the server will get on match
@@ -74,7 +74,7 @@ func ExtractForwardedMessage(formValues url.Values) ForwardedMessage {
 }
 
 // ListRoutes allows you to iterate through a list of routes returned by the API
-func (mg *MailgunImpl) ListRoutes(opts *ListOptions) *RoutesIterator {
+func (mg *Client) ListRoutes(opts *ListOptions) *RoutesIterator {
 	var limit int
 	if opts != nil {
 		limit = opts.Limit
@@ -229,7 +229,7 @@ func (ri *RoutesIterator) fetch(ctx context.Context, skip, limit int) error {
 // The route structure you provide serves as a template, and
 // only a subset of the fields influence the operation.
 // See the Route structure definition for more details.
-func (mg *MailgunImpl) CreateRoute(ctx context.Context, prototype mtypes.Route) (_ignored mtypes.Route, err error) {
+func (mg *Client) CreateRoute(ctx context.Context, prototype mtypes.Route) (_ignored mtypes.Route, err error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, routesEndpoint))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -251,7 +251,7 @@ func (mg *MailgunImpl) CreateRoute(ctx context.Context, prototype mtypes.Route)
 // DeleteRoute removes the specified route from your domain's configuration.
 // To avoid ambiguity, Mailgun identifies the route by unique ID.
 // See the Route structure definition and the Mailgun API documentation for more details.
-func (mg *MailgunImpl) DeleteRoute(ctx context.Context, id string) error {
+func (mg *Client) DeleteRoute(ctx context.Context, id string) error {
 	r := newHTTPRequest(generateApiUrl(mg, 3, routesEndpoint) + "/" + id)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -260,7 +260,7 @@ func (mg *MailgunImpl) DeleteRoute(ctx context.Context, id string) error {
 }
 
 // GetRoute retrieves the complete route definition associated with the unique route ID.
-func (mg *MailgunImpl) GetRoute(ctx context.Context, id string) (mtypes.Route, error) {
+func (mg *Client) GetRoute(ctx context.Context, id string) (mtypes.Route, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, routesEndpoint) + "/" + id)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -279,7 +279,7 @@ func (mg *MailgunImpl) GetRoute(ctx context.Context, id string) (mtypes.Route, e
 // UpdateRoute provides an "in-place" update of the specified route.
 // Only those route fields which are non-zero or non-empty are updated.
 // All other fields remain as-is.
-func (mg *MailgunImpl) UpdateRoute(ctx context.Context, id string, route mtypes.Route) (mtypes.Route, error) {
+func (mg *Client) UpdateRoute(ctx context.Context, id string, route mtypes.Route) (mtypes.Route, error) {
 	r := newHTTPRequest(generateApiUrl(mg, 3, routesEndpoint) + "/" + id)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/spam_complaints.go b/spam_complaints.go
index 0a8802b..03882b7 100644
--- a/spam_complaints.go
+++ b/spam_complaints.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"strconv"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 const (
@@ -14,7 +14,7 @@ const (
 // ListComplaints returns a set of spam complaints registered against your domain.
 // Recipients of your messages can click on a link which sends feedback to Mailgun
 // indicating that the message they received is, to them, spam.
-func (mg *MailgunImpl) ListComplaints(domain string, opts *ListOptions) *ComplaintsIterator {
+func (mg *Client) ListComplaints(domain string, opts *ListOptions) *ComplaintsIterator {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, complaintsEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -127,7 +127,7 @@ func (ci *ComplaintsIterator) fetch(ctx context.Context, url string) error {
 
 // GetComplaint returns a single complaint record filed by a recipient at the email address provided.
 // If no complaint exists, the Complaint instance returned will be empty.
-func (mg *MailgunImpl) GetComplaint(ctx context.Context, domain, address string) (mtypes.Complaint, error) {
+func (mg *Client) GetComplaint(ctx context.Context, domain, address string) (mtypes.Complaint, error) {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, complaintsEndpoint, domain) + "/" + address)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -139,7 +139,7 @@ func (mg *MailgunImpl) GetComplaint(ctx context.Context, domain, address string)
 
 // CreateComplaint registers the specified address as a recipient who has complained of receiving spam
 // from your domain.
-func (mg *MailgunImpl) CreateComplaint(ctx context.Context, domain, address string) error {
+func (mg *Client) CreateComplaint(ctx context.Context, domain, address string) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, complaintsEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -149,7 +149,7 @@ func (mg *MailgunImpl) CreateComplaint(ctx context.Context, domain, address stri
 	return err
 }
 
-func (mg *MailgunImpl) CreateComplaints(ctx context.Context, domain string, addresses []string) error {
+func (mg *Client) CreateComplaints(ctx context.Context, domain string, addresses []string) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, complaintsEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -167,7 +167,7 @@ func (mg *MailgunImpl) CreateComplaints(ctx context.Context, domain string, addr
 
 // DeleteComplaint removes a previously registered e-mail address from the list of people who complained
 // of receiving spam from your domain.
-func (mg *MailgunImpl) DeleteComplaint(ctx context.Context, domain, address string) error {
+func (mg *Client) DeleteComplaint(ctx context.Context, domain, address string) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, complaintsEndpoint, domain) + "/" + address)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/stored_messages.go b/stored_messages.go
index 588c299..ee0c3d5 100644
--- a/stored_messages.go
+++ b/stored_messages.go
@@ -4,12 +4,12 @@ import (
 	"context"
 	"errors"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // GetStoredMessage retrieves information about a received e-mail message.
 // This provides visibility into, e.g., replies to a message sent to a mailing list.
-func (mg *MailgunImpl) GetStoredMessage(ctx context.Context, url string) (mtypes.StoredMessage, error) {
+func (mg *Client) GetStoredMessage(ctx context.Context, url string) (mtypes.StoredMessage, error) {
 	r := newHTTPRequest(url)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -21,7 +21,7 @@ func (mg *MailgunImpl) GetStoredMessage(ctx context.Context, url string) (mtypes
 
 // ReSend given a storage id resend the stored message to the specified recipients
 // TODO(v5): return SendMessageResponse
-func (mg *MailgunImpl) ReSend(ctx context.Context, url string, recipients ...string) (msg, id string, err error) {
+func (mg *Client) ReSend(ctx context.Context, url string, recipients ...string) (msg, id string, err error) {
 	r := newHTTPRequest(url)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -48,7 +48,7 @@ func (mg *MailgunImpl) ReSend(ctx context.Context, url string, recipients ...str
 // GetStoredMessageRaw retrieves the raw MIME body of a received e-mail message.
 // Compared to GetStoredMessage, it gives access to the unparsed MIME body, and
 // thus delegates to the caller the required parsing.
-func (mg *MailgunImpl) GetStoredMessageRaw(ctx context.Context, url string) (mtypes.StoredMessageRaw, error) {
+func (mg *Client) GetStoredMessageRaw(ctx context.Context, url string) (mtypes.StoredMessageRaw, error) {
 	r := newHTTPRequest(url)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -60,7 +60,7 @@ func (mg *MailgunImpl) GetStoredMessageRaw(ctx context.Context, url string) (mty
 }
 
 // GetStoredAttachment retrieves the raw MIME body of a received e-mail message attachment.
-func (mg *MailgunImpl) GetStoredAttachment(ctx context.Context, url string) ([]byte, error) {
+func (mg *Client) GetStoredAttachment(ctx context.Context, url string) ([]byte, error) {
 	r := newHTTPRequest(url)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/subaccounts.go b/subaccounts.go
index 62fd304..9fa4c16 100644
--- a/subaccounts.go
+++ b/subaccounts.go
@@ -5,7 +5,7 @@ import (
 	"fmt"
 	"strconv"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 type ListSubaccountsOptions struct {
@@ -29,7 +29,7 @@ type SubaccountsIterator struct {
 }
 
 // ListSubaccounts retrieves a set of subaccount linked to the primary Mailgun account.
-func (mg *MailgunImpl) ListSubaccounts(opts *ListSubaccountsOptions) *SubaccountsIterator {
+func (mg *Client) ListSubaccounts(opts *ListSubaccountsOptions) *SubaccountsIterator {
 	r := newHTTPRequest(generateSubaccountsApiUrl(mg))
 	r.setClient(mg.client)
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -185,7 +185,7 @@ func (ri *SubaccountsIterator) fetch(ctx context.Context, skip, limit int) error
 // Subaccounts are child accounts that share the same plan and usage allocations as the primary, but have their own
 // assets (sending domains, unique users, API key, SMTP credentials, settings, statistics and site login).
 // All you need is the name of the subaccount.
-func (mg *MailgunImpl) CreateSubaccount(ctx context.Context, subaccountName string) (mtypes.SubaccountResponse, error) {
+func (mg *Client) CreateSubaccount(ctx context.Context, subaccountName string) (mtypes.SubaccountResponse, error) {
 	r := newHTTPRequest(generateSubaccountsApiUrl(mg))
 	r.setClient(mg.client)
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -198,7 +198,7 @@ func (mg *MailgunImpl) CreateSubaccount(ctx context.Context, subaccountName stri
 }
 
 // GetSubaccount retrieves detailed information about subaccount using subaccountID.
-func (mg *MailgunImpl) GetSubaccount(ctx context.Context, subaccountID string) (mtypes.SubaccountResponse, error) {
+func (mg *Client) GetSubaccount(ctx context.Context, subaccountID string) (mtypes.SubaccountResponse, error) {
 	r := newHTTPRequest(generateSubaccountsApiUrl(mg) + "/" + subaccountID)
 	r.setClient(mg.client)
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -209,7 +209,7 @@ func (mg *MailgunImpl) GetSubaccount(ctx context.Context, subaccountID string) (
 }
 
 // EnableSubaccount instructs Mailgun to enable subaccount.
-func (mg *MailgunImpl) EnableSubaccount(ctx context.Context, subaccountId string) (mtypes.SubaccountResponse, error) {
+func (mg *Client) EnableSubaccount(ctx context.Context, subaccountId string) (mtypes.SubaccountResponse, error) {
 	r := newHTTPRequest(generateSubaccountsApiUrl(mg) + "/" + subaccountId + "/" + "enable")
 	r.setClient(mg.client)
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -220,7 +220,7 @@ func (mg *MailgunImpl) EnableSubaccount(ctx context.Context, subaccountId string
 }
 
 // DisableSubaccount instructs Mailgun to disable subaccount.
-func (mg *MailgunImpl) DisableSubaccount(ctx context.Context, subaccountId string) (mtypes.SubaccountResponse, error) {
+func (mg *Client) DisableSubaccount(ctx context.Context, subaccountId string) (mtypes.SubaccountResponse, error) {
 	r := newHTTPRequest(generateSubaccountsApiUrl(mg) + "/" + subaccountId + "/" + "disable")
 	r.setClient(mg.client)
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/tags.go b/tags.go
index 5e7cbef..fff9942 100644
--- a/tags.go
+++ b/tags.go
@@ -5,7 +5,7 @@ import (
 	"net/url"
 	"strconv"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 type ListTagOptions struct {
@@ -16,7 +16,7 @@ type ListTagOptions struct {
 }
 
 // DeleteTag removes all counters for a particular tag, including the tag itself.
-func (mg *MailgunImpl) DeleteTag(ctx context.Context, domain, tag string) error {
+func (mg *Client) DeleteTag(ctx context.Context, domain, tag string) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, tagsEndpoint, domain) + "/" + tag)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -25,7 +25,7 @@ func (mg *MailgunImpl) DeleteTag(ctx context.Context, domain, tag string) error
 }
 
 // GetTag retrieves metadata about the tag from the api
-func (mg *MailgunImpl) GetTag(ctx context.Context, domain, tag string) (mtypes.Tag, error) {
+func (mg *Client) GetTag(ctx context.Context, domain, tag string) (mtypes.Tag, error) {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, tagsEndpoint, domain) + "/" + tag)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -46,7 +46,7 @@ func (mg *MailgunImpl) GetTag(ctx context.Context, domain, tag string) (mtypes.T
 //	if it.Err() != nil {
 //		log.Fatal(it.Err())
 //	}
-func (mg *MailgunImpl) ListTags(domain string, opts *ListTagOptions) *TagIterator {
+func (mg *Client) ListTags(domain string, opts *ListTagOptions) *TagIterator {
 	req := newHTTPRequest(generateApiV3UrlWithDomain(mg, tagsEndpoint, domain))
 	if opts != nil {
 		if opts.Limit != 0 {
diff --git a/template.go b/template.go
index 09ae09b..8e3a3b5 100644
--- a/template.go
+++ b/template.go
@@ -5,11 +5,11 @@ import (
 	"errors"
 	"strconv"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // Create a new template which can be used to attach template versions to
-func (mg *MailgunImpl) CreateTemplate(ctx context.Context, domain string, template *mtypes.Template) error {
+func (mg *Client) CreateTemplate(ctx context.Context, domain string, template *mtypes.Template) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, templatesEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -45,7 +45,7 @@ func (mg *MailgunImpl) CreateTemplate(ctx context.Context, domain string, templa
 }
 
 // GetTemplate gets a template given the template name
-func (mg *MailgunImpl) GetTemplate(ctx context.Context, domain, name string) (mtypes.Template, error) {
+func (mg *Client) GetTemplate(ctx context.Context, domain, name string) (mtypes.Template, error) {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, templatesEndpoint, domain) + "/" + name)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -60,7 +60,7 @@ func (mg *MailgunImpl) GetTemplate(ctx context.Context, domain, name string) (mt
 }
 
 // Update the name and description of a template
-func (mg *MailgunImpl) UpdateTemplate(ctx context.Context, domain string, template *mtypes.Template) error {
+func (mg *Client) UpdateTemplate(ctx context.Context, domain string, template *mtypes.Template) error {
 	if template.Name == "" {
 		return errors.New("UpdateTemplate() Template.Name cannot be empty")
 	}
@@ -87,7 +87,7 @@ func (mg *MailgunImpl) UpdateTemplate(ctx context.Context, domain string, templa
 }
 
 // Delete a template given a template name
-func (mg *MailgunImpl) DeleteTemplate(ctx context.Context, domain, name string) error {
+func (mg *Client) DeleteTemplate(ctx context.Context, domain, name string) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, templatesEndpoint, domain) + "/" + name)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -107,7 +107,7 @@ type ListTemplateOptions struct {
 }
 
 // List all available templates
-func (mg *MailgunImpl) ListTemplates(domain string, opts *ListTemplateOptions) *TemplatesIterator {
+func (mg *Client) ListTemplates(domain string, opts *ListTemplateOptions) *TemplatesIterator {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, templatesEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/template_versions.go b/template_versions.go
index 31e472c..5b9ac47 100644
--- a/template_versions.go
+++ b/template_versions.go
@@ -4,11 +4,11 @@ import (
 	"context"
 	"strconv"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // AddTemplateVersion adds a template version to a template
-func (mg *MailgunImpl) AddTemplateVersion(ctx context.Context, domain, templateName string, version *mtypes.TemplateVersion) error {
+func (mg *Client) AddTemplateVersion(ctx context.Context, domain, templateName string, version *mtypes.TemplateVersion) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, templatesEndpoint, domain) + "/" + templateName + "/versions")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -38,7 +38,7 @@ func (mg *MailgunImpl) AddTemplateVersion(ctx context.Context, domain, templateN
 }
 
 // GetTemplateVersion gets a specific version of a template
-func (mg *MailgunImpl) GetTemplateVersion(ctx context.Context, domain, templateName, tag string) (mtypes.TemplateVersion, error) {
+func (mg *Client) GetTemplateVersion(ctx context.Context, domain, templateName, tag string) (mtypes.TemplateVersion, error) {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, templatesEndpoint, domain) + "/" + templateName + "/versions/" + tag)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -52,7 +52,7 @@ func (mg *MailgunImpl) GetTemplateVersion(ctx context.Context, domain, templateN
 }
 
 // Update the comment and mark a version of a template active
-func (mg *MailgunImpl) UpdateTemplateVersion(ctx context.Context, domain, templateName string, version *mtypes.TemplateVersion) error {
+func (mg *Client) UpdateTemplateVersion(ctx context.Context, domain, templateName string, version *mtypes.TemplateVersion) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, templatesEndpoint, domain) + "/" + templateName + "/versions/" + version.Tag)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -78,7 +78,7 @@ func (mg *MailgunImpl) UpdateTemplateVersion(ctx context.Context, domain, templa
 }
 
 // Delete a specific version of a template
-func (mg *MailgunImpl) DeleteTemplateVersion(ctx context.Context, domain, templateName, tag string) error {
+func (mg *Client) DeleteTemplateVersion(ctx context.Context, domain, templateName, tag string) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, templatesEndpoint, domain) + "/" + templateName + "/versions/" + tag)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -93,7 +93,7 @@ type TemplateVersionsIterator struct {
 }
 
 // ListTemplateVersions lists all the versions of a specific template
-func (mg *MailgunImpl) ListTemplateVersions(domain, templateName string, opts *ListOptions) *TemplateVersionsIterator {
+func (mg *Client) ListTemplateVersions(domain, templateName string, opts *ListOptions) *TemplateVersionsIterator {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, templatesEndpoint, domain) + "/" + templateName + "/versions")
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/unsubscribes.go b/unsubscribes.go
index 7148859..52aca4c 100644
--- a/unsubscribes.go
+++ b/unsubscribes.go
@@ -4,11 +4,11 @@ import (
 	"context"
 	"strconv"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // Fetches the list of unsubscribes
-func (mg *MailgunImpl) ListUnsubscribes(domain string, opts *ListOptions) *UnsubscribesIterator {
+func (mg *Client) ListUnsubscribes(domain string, opts *ListOptions) *UnsubscribesIterator {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, unsubscribesEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -120,7 +120,7 @@ func (ci *UnsubscribesIterator) fetch(ctx context.Context, url string) error {
 }
 
 // Retreives a single unsubscribe record. Can be used to check if a given address is present in the list of unsubscribed users.
-func (mg *MailgunImpl) GetUnsubscribe(ctx context.Context, domain, address string) (mtypes.Unsubscribe, error) {
+func (mg *Client) GetUnsubscribe(ctx context.Context, domain, address string) (mtypes.Unsubscribe, error) {
 	r := newHTTPRequest(generateApiV3UrlWithTarget(mg, unsubscribesEndpoint, domain, address))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -132,7 +132,7 @@ func (mg *MailgunImpl) GetUnsubscribe(ctx context.Context, domain, address strin
 }
 
 // Unsubscribe adds an e-mail address to the domain's unsubscription table.
-func (mg *MailgunImpl) CreateUnsubscribe(ctx context.Context, domain, address, tag string) error {
+func (mg *Client) CreateUnsubscribe(ctx context.Context, domain, address, tag string) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, unsubscribesEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -144,7 +144,7 @@ func (mg *MailgunImpl) CreateUnsubscribe(ctx context.Context, domain, address, t
 }
 
 // CreateUnsubscribes adds multiple e-mail addresses to the domain's unsubscription table.
-func (mg *MailgunImpl) CreateUnsubscribes(ctx context.Context, domain string, unsubscribes []mtypes.Unsubscribe) error {
+func (mg *Client) CreateUnsubscribes(ctx context.Context, domain string, unsubscribes []mtypes.Unsubscribe) error {
 	r := newHTTPRequest(generateApiV3UrlWithDomain(mg, unsubscribesEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -158,7 +158,7 @@ func (mg *MailgunImpl) CreateUnsubscribes(ctx context.Context, domain string, un
 // DeleteUnsubscribe removes the e-mail address given from the domain's unsubscription table.
 // If passing in an ID (discoverable from, e.g., ListUnsubscribes()), the e-mail address associated
 // with the given ID will be removed.
-func (mg *MailgunImpl) DeleteUnsubscribe(ctx context.Context, domain, address string) error {
+func (mg *Client) DeleteUnsubscribe(ctx context.Context, domain, address string) error {
 	r := newHTTPRequest(generateApiV3UrlWithTarget(mg, unsubscribesEndpoint, domain, address))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -169,7 +169,7 @@ func (mg *MailgunImpl) DeleteUnsubscribe(ctx context.Context, domain, address st
 // DeleteUnsubscribeWithTag removes the e-mail address given from the domain's unsubscription table with a matching tag.
 // If passing in an ID (discoverable from, e.g., ListUnsubscribes()), the e-mail address associated
 // with the given ID will be removed.
-func (mg *MailgunImpl) DeleteUnsubscribeWithTag(ctx context.Context, domain, a, t string) error {
+func (mg *Client) DeleteUnsubscribeWithTag(ctx context.Context, domain, a, t string) error {
 	r := newHTTPRequest(generateApiV3UrlWithTarget(mg, unsubscribesEndpoint, domain, a))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
diff --git a/validation.go b/validation.go
index 3e7300e..18714e1 100644
--- a/validation.go
+++ b/validation.go
@@ -4,13 +4,13 @@ import (
 	"context"
 	"fmt"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // ValidateEmail performs various checks on the email address provided to ensure it's correctly formatted.
 // It may also be used to break an email address into its sub-components.
 // https://documentation.mailgun.com/docs/inboxready/mailgun-validate/single-valid-ir/
-func (mg *MailgunImpl) ValidateEmail(ctx context.Context, email string, mailBoxVerify bool) (mtypes.ValidateEmailResponse, error) {
+func (mg *Client) ValidateEmail(ctx context.Context, email string, mailBoxVerify bool) (mtypes.ValidateEmailResponse, error) {
 	r := newHTTPRequest(fmt.Sprintf("%s/v4/address/validate", mg.APIBase()))
 	r.setClient(mg.HTTPClient())
 	r.addParameter("address", email)
diff --git a/webhooks.go b/webhooks.go
index 68e58f1..a5b9418 100644
--- a/webhooks.go
+++ b/webhooks.go
@@ -11,12 +11,12 @@ import (
 	"fmt"
 	"io"
 
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
 // ListWebhooks returns the complete set of webhooks configured for your domain.
 // Note that a zero-length mapping is not an error.
-func (mg *MailgunImpl) ListWebhooks(ctx context.Context, domain string) (map[string][]string, error) {
+func (mg *Client) ListWebhooks(ctx context.Context, domain string) (map[string][]string, error) {
 	r := newHTTPRequest(generateV3DomainsApiUrl(mg, webhooksEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -40,7 +40,7 @@ func (mg *MailgunImpl) ListWebhooks(ctx context.Context, domain string) (map[str
 }
 
 // CreateWebhook installs a new webhook for your domain.
-func (mg *MailgunImpl) CreateWebhook(ctx context.Context, domain, id string, urls []string) error {
+func (mg *Client) CreateWebhook(ctx context.Context, domain, id string, urls []string) error {
 	r := newHTTPRequest(generateV3DomainsApiUrl(mg, webhooksEndpoint, domain))
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -54,7 +54,7 @@ func (mg *MailgunImpl) CreateWebhook(ctx context.Context, domain, id string, url
 }
 
 // DeleteWebhook removes the specified webhook from your domain's configuration.
-func (mg *MailgunImpl) DeleteWebhook(ctx context.Context, domain, name string) error {
+func (mg *Client) DeleteWebhook(ctx context.Context, domain, name string) error {
 	r := newHTTPRequest(generateV3DomainsApiUrl(mg, webhooksEndpoint, domain) + "/" + name)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -63,7 +63,7 @@ func (mg *MailgunImpl) DeleteWebhook(ctx context.Context, domain, name string) e
 }
 
 // GetWebhook retrieves the currently assigned webhook URL associated with the provided type of webhook.
-func (mg *MailgunImpl) GetWebhook(ctx context.Context, domain, name string) ([]string, error) {
+func (mg *Client) GetWebhook(ctx context.Context, domain, name string) ([]string, error) {
 	r := newHTTPRequest(generateV3DomainsApiUrl(mg, webhooksEndpoint, domain) + "/" + name)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -82,7 +82,7 @@ func (mg *MailgunImpl) GetWebhook(ctx context.Context, domain, name string) ([]s
 }
 
 // UpdateWebhook replaces one webhook setting for another.
-func (mg *MailgunImpl) UpdateWebhook(ctx context.Context, domain, name string, urls []string) error {
+func (mg *Client) UpdateWebhook(ctx context.Context, domain, name string, urls []string) error {
 	r := newHTTPRequest(generateV3DomainsApiUrl(mg, webhooksEndpoint, domain) + "/" + name)
 	r.setClient(mg.HTTPClient())
 	r.setBasicAuth(basicAuthUser, mg.APIKey())
@@ -95,7 +95,7 @@ func (mg *MailgunImpl) UpdateWebhook(ctx context.Context, domain, name string, u
 }
 
 // VerifyWebhookSignature - use this method to parse the webhook signature given as JSON in the webhook response
-func (mg *MailgunImpl) VerifyWebhookSignature(sig mtypes.Signature) (verified bool, err error) {
+func (mg *Client) VerifyWebhookSignature(sig mtypes.Signature) (verified bool, err error) {
 	webhookSigningKey := mg.WebhookSigningKey()
 	if webhookSigningKey == "" {
 		return false, fmt.Errorf("webhook signing key is not set")


Test patch:
diff --git a/analytics_test.go b/analytics_test.go
index 970600b..de96750 100644
--- a/analytics_test.go
+++ b/analytics_test.go
@@ -4,8 +4,8 @@ import (
 	"context"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/attachments_test.go b/attachments_test.go
index 620900e..ea844fc 100644
--- a/attachments_test.go
+++ b/attachments_test.go
@@ -7,8 +7,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/events"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/events"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/bounces_test.go b/bounces_test.go
index 489b0d9..f5a9e11 100644
--- a/bounces_test.go
+++ b/bounces_test.go
@@ -9,8 +9,8 @@ import (
 	"testing"
 	"time"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/credentials_test.go b/credentials_test.go
index cb2ccac..efed78c 100644
--- a/credentials_test.go
+++ b/credentials_test.go
@@ -6,8 +6,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/domain_keys_test.go b/domain_keys_test.go
index 1f8e1a3..e5297a1 100644
--- a/domain_keys_test.go
+++ b/domain_keys_test.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
+	"github.com/mailgun/mailgun-go/v5"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/domains_connection_test.go b/domains_connection_test.go
index 386fbf4..7c4b068 100644
--- a/domains_connection_test.go
+++ b/domains_connection_test.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
+	"github.com/mailgun/mailgun-go/v5"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/domains_test.go b/domains_test.go
index f51a2c8..c2de24e 100644
--- a/domains_test.go
+++ b/domains_test.go
@@ -5,8 +5,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/domains_tracking_test.go b/domains_tracking_test.go
index 2600c45..db6b5aa 100644
--- a/domains_tracking_test.go
+++ b/domains_tracking_test.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
+	"github.com/mailgun/mailgun-go/v5"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/events_test.go b/events_test.go
index ca7379b..84ac6d2 100644
--- a/events_test.go
+++ b/events_test.go
@@ -6,8 +6,8 @@ import (
 	"testing"
 	"time"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/events"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/events"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
@@ -113,7 +113,7 @@ func TestEventPoller(t *testing.T) {
 	assert.Equal(t, "user@"+testDomain, accepted.Recipient)
 }
 
-func ExampleMailgunImpl_ListEvents() {
+func ExampleMailgun_ListEvents() {
 	mg := mailgun.NewMailgun("your-api-key")
 	_ = mg.SetAPIBase(server.URL())
 
diff --git a/examples_test.go b/examples_test.go
index bc153dd..03b567e 100644
--- a/examples_test.go
+++ b/examples_test.go
@@ -11,12 +11,12 @@ import (
 	"strings"
 	"time"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/events"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/events"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 )
 
-func ExampleMailgunImpl_ValidateEmail() {
+func ExampleMailgun_ValidateEmail() {
 	mg := mailgun.NewMailgun("my_api_key")
 
 	ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
@@ -33,7 +33,7 @@ func ExampleMailgunImpl_ValidateEmail() {
 	}
 }
 
-func ExampleMailgunImpl_UpdateMailingList() {
+func ExampleMailgun_UpdateMailingList() {
 	mg := mailgun.NewMailgun("my_api_key")
 
 	ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
@@ -49,7 +49,7 @@ func ExampleMailgunImpl_UpdateMailingList() {
 	}
 }
 
-func ExampleMailgunImpl_Send_constructed() {
+func ExampleMailgun_Send_constructed() {
 	mg := mailgun.NewMailgun("my_api_key")
 
 	ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
@@ -74,7 +74,7 @@ func ExampleMailgunImpl_Send_constructed() {
 	log.Printf("Message id=%s", id)
 }
 
-func ExampleMailgunImpl_Send_mime() {
+func ExampleMailgun_Send_mime() {
 	exampleMime := `Content-Type: text/plain; charset="ascii"
 Subject: Joe's Example Subject
 From: Joe Example <joe@example.com>
@@ -98,7 +98,7 @@ Testing some Mailgun MIME awesomeness!
 	log.Printf("Message id=%s", id)
 }
 
-func ExampleMailgunImpl_ListRoutes() {
+func ExampleMailgun_ListRoutes() {
 	mg := mailgun.NewMailgun("my_api_key")
 	ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
 	defer cancel()
@@ -116,7 +116,7 @@ func ExampleMailgunImpl_ListRoutes() {
 	}
 }
 
-func ExampleMailgunImpl_VerifyWebhookSignature() {
+func ExampleMailgun_VerifyWebhookSignature() {
 	// Create an instance of the Mailgun Client
 	mg, err := mailgun.NewMailgunFromEnv()
 	if err != nil {
diff --git a/exports_test.go b/exports_test.go
index 6554a63..c960d1c 100644
--- a/exports_test.go
+++ b/exports_test.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
+	"github.com/mailgun/mailgun-go/v5"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/integration_test.go b/integration_test.go
index c013b7c..e3b9b1a 100644
--- a/integration_test.go
+++ b/integration_test.go
@@ -10,8 +10,8 @@ import (
 	"testing"
 	"time"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/ips_test.go b/ips_test.go
index cb9fe6f..23c207e 100644
--- a/ips_test.go
+++ b/ips_test.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
+	"github.com/mailgun/mailgun-go/v5"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/limits_test.go b/limits_test.go
index 7204704..20fe74c 100644
--- a/limits_test.go
+++ b/limits_test.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
+	"github.com/mailgun/mailgun-go/v5"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/mailgun_test.go b/mailgun_test.go
index d576aa6..53c103e 100644
--- a/mailgun_test.go
+++ b/mailgun_test.go
@@ -7,9 +7,9 @@ import (
 	"os"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mocks"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mocks"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/mailing_lists_test.go b/mailing_lists_test.go
index ae07a30..49e17bf 100644
--- a/mailing_lists_test.go
+++ b/mailing_lists_test.go
@@ -5,8 +5,8 @@ import (
 	"fmt"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/messages_test.go b/messages_test.go
index 626d8e6..d668e97 100644
--- a/messages_test.go
+++ b/messages_test.go
@@ -11,7 +11,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/mailgun/mailgun-go/v4"
+	"github.com/mailgun/mailgun-go/v5"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/routes_test.go b/routes_test.go
index 0410071..cbde30e 100644
--- a/routes_test.go
+++ b/routes_test.go
@@ -4,8 +4,8 @@ import (
 	"context"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/spam_complaints_test.go b/spam_complaints_test.go
index 11b9d0e..465a00a 100644
--- a/spam_complaints_test.go
+++ b/spam_complaints_test.go
@@ -6,8 +6,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/storage_test.go b/storage_test.go
index 934a493..9922476 100644
--- a/storage_test.go
+++ b/storage_test.go
@@ -6,8 +6,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/events"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/events"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/subaccounts_test.go b/subaccounts_test.go
index 3032b3e..9db6f06 100644
--- a/subaccounts_test.go
+++ b/subaccounts_test.go
@@ -5,8 +5,8 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/tags_test.go b/tags_test.go
index e984c60..2c622b6 100644
--- a/tags_test.go
+++ b/tags_test.go
@@ -6,8 +6,8 @@ import (
 	"time"
 
 	"github.com/mailgun/errors"
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/template_test.go b/template_test.go
index f1c3e9a..b65dc9e 100644
--- a/template_test.go
+++ b/template_test.go
@@ -7,8 +7,8 @@ import (
 	"time"
 
 	"github.com/mailgun/errors"
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/template_versions_test.go b/template_versions_test.go
index ff194e6..7feaf24 100644
--- a/template_versions_test.go
+++ b/template_versions_test.go
@@ -4,8 +4,8 @@ import (
 	"context"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/unsubscribes_test.go b/unsubscribes_test.go
index 74a6ad1..2b1934b 100644
--- a/unsubscribes_test.go
+++ b/unsubscribes_test.go
@@ -5,8 +5,8 @@ import (
 	"os"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/require"
 )
 
diff --git a/validation_test.go b/validation_test.go
index 809c235..789728a 100644
--- a/validation_test.go
+++ b/validation_test.go
@@ -4,7 +4,7 @@ import (
 	"context"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
+	"github.com/mailgun/mailgun-go/v5"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )
diff --git a/webhooks_test.go b/webhooks_test.go
index e9d020b..021b248 100644
--- a/webhooks_test.go
+++ b/webhooks_test.go
@@ -8,8 +8,8 @@ import (
 	"io"
 	"testing"
 
-	"github.com/mailgun/mailgun-go/v4"
-	"github.com/mailgun/mailgun-go/v4/mtypes"
+	"github.com/mailgun/mailgun-go/v5"
+	"github.com/mailgun/mailgun-go/v5/mtypes"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )