From df0e8a7158e74dd6f0def969ee49958addb81ca1 Mon Sep 17 00:00:00 2001 From: Vilen Topchii <32271530+vtopc@users.noreply.github.com> Date: Fri, 25 Oct 2024 20:43:52 +0300 Subject: [PATCH] better namings --- analytics.go | 4 ++-- analytics_test.go | 2 +- integration_test.go | 2 +- mailgun.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/analytics.go b/analytics.go index d4d0b54..214c0f5 100644 --- a/analytics.go +++ b/analytics.go @@ -18,13 +18,13 @@ type AnalyticsMetricsPagination struct { Total int `json:"total"` } -// ListMetrics returns domain/account metrics. +// ListAnalyticsMetrics returns domain/account metrics. // // NOTE: Only for v1 API. To use the /v1 version define MG_URL in the environment variable // as `https://api.mailgun.net/v1` or set `mg.SetAPIBase("https://api.mailgun.net/v1")` // // https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Metrics/ -func (mg *MailgunImpl) ListMetrics(opts AnalyticsMetricsOptions) (*AnalyticsMetricsIterator, error) { +func (mg *MailgunImpl) ListAnalyticsMetrics(opts AnalyticsMetricsOptions) (*AnalyticsMetricsIterator, error) { if !strings.HasSuffix(mg.APIBase(), "/v1") { return nil, errors.New("only v1 API is supported") } diff --git a/analytics_test.go b/analytics_test.go index 476084b..cb9d702 100644 --- a/analytics_test.go +++ b/analytics_test.go @@ -53,7 +53,7 @@ func TestListMetrics(t *testing.T) { }, } - it, err := mg.ListMetrics(opts) + it, err := mg.ListAnalyticsMetrics(opts) require.NoError(t, err) var page mailgun.AnalyticsMetricsResponse diff --git a/integration_test.go b/integration_test.go index 50f8b16..391e015 100644 --- a/integration_test.go +++ b/integration_test.go @@ -27,7 +27,7 @@ func TestIntegrationMailgunImpl_ListMetrics(t *testing.T) { }, } - iter, err := mg.ListMetrics(opts) + iter, err := mg.ListAnalyticsMetrics(opts) require.NoError(t, err) // create context to list all pages diff --git a/mailgun.go b/mailgun.go index a68fe16..861699b 100644 --- a/mailgun.go +++ b/mailgun.go @@ -151,7 +151,7 @@ type Mailgun interface { DeleteBounce(ctx context.Context, address string) error DeleteBounceList(ctx context.Context) error - ListMetrics(opts AnalyticsMetricsOptions) (*AnalyticsMetricsIterator, error) + ListAnalyticsMetrics(opts AnalyticsMetricsOptions) (*AnalyticsMetricsIterator, error) // Deprecated: Use ListMetrics instead. GetStats(ctx context.Context, events []string, opts *GetStatOptions) ([]Stats, error)