Skip to content

Commit

Permalink
better namings
Browse files Browse the repository at this point in the history
  • Loading branch information
vtopc committed Oct 25, 2024
1 parent 016fc78 commit df0e8a7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions analytics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion analytics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mailgun.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit df0e8a7

Please sign in to comment.