From 938ecf7cd18c600f72e4e45258475c4ce5351b31 Mon Sep 17 00:00:00 2001 From: Hassansin Date: Fri, 30 Jul 2021 16:04:25 +0600 Subject: [PATCH] =?UTF-8?q?Revert=20"Support=20customer=20scoped=20Activit?= =?UTF-8?q?ies=20and=20unscoped=20Activities=20[c=E2=80=A6=20(#45)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "Support customer scoped Activities and unscoped Activities [ch30595] (#42)" This reverts commit e06a2f7b0465998e46162dd84a83c7b4da2568db. * Added go 1.6 in build matrix --- .github/workflows/test.yml | 2 +- 2.0-Upgrade.md | 8 --- README.md | 6 +- chartmogul.go | 12 +--- .../connect_subscription_test.go | 2 +- metrics_activities.go | 49 +++++++-------- metrics_activities_test.go | 61 ------------------- metrics_customer_activities.go | 39 ------------ metrics_customer_activities_test.go | 58 ------------------ metrics_customer_subscriptions.go | 43 ------------- metrics_customer_subscriptions_test.go | 61 ------------------- metrics_subscriptions.go | 43 +++++++++++++ mock_chartmogul/chartmogul.go | 57 ++++++++++------- 13 files changed, 106 insertions(+), 335 deletions(-) delete mode 100644 2.0-Upgrade.md delete mode 100644 metrics_activities_test.go delete mode 100644 metrics_customer_activities.go delete mode 100644 metrics_customer_activities_test.go delete mode 100644 metrics_customer_subscriptions.go delete mode 100644 metrics_customer_subscriptions_test.go create mode 100644 metrics_subscriptions.go diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8007b54..a61fe64 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-versions: ['1.11', '1.12', '1.13', '1.14'] + go-versions: ['1.11', '1.12', '1.13', '1.14', '1.16'] steps: - uses: actions/checkout@v2 diff --git a/2.0-Upgrade.md b/2.0-Upgrade.md deleted file mode 100644 index 2f06b89..0000000 --- a/2.0-Upgrade.md +++ /dev/null @@ -1,8 +0,0 @@ -# Upgrading to chartmogul-go 2.0.0 - -The package upgrade brings breaking changes to the Metrics API. All other APIs remain unaffected. Please note the following changes: - -* If you used the Metrics API to get a customer's activities or subscriptions, make the following changes in the namespace - - `api.MetricsListSubscriptions(&cm.Cursor{PerPage: 1},"cus_922c2672-ee04-11e6-bea8-7fac984477db")` should be replaced with `api.MetricsListCustomerSubscriptions(&cm.Cursor{PerPage: 1},"cus_922c2672-ee04-11e6-bea8-7fac984477db")` - - `api.MetricsListActivities(&cm.Cursor{PerPage: 1},"cus_922c2672-ee04-11e6-bea8-7fac984477db") -` should be replaced with `api.MetricsListCustomerActivities(&cm.Cursor{PerPage: 1},"cus_922c2672-ee04-11e6-bea8-7fac984477db")` diff --git a/README.md b/README.md index 544692b..c90e309 100644 --- a/README.md +++ b/README.md @@ -190,10 +190,8 @@ api.MetricsRetrieveCustomerChurnRate(&MetricsFilter{}) api.MetricsRetrieveMRRChurnRate(&MetricsFilter{}) api.MetricsRetrieveLTV(&MetricsFilter{}) -api.MetricsListCustomerSubscriptions(&Cursor{}, "customerUUID") -api.MetricsListCustomerActivities(&Cursor{}, "customerUUID") - -api.MetricsListActivities(&cm.MetricsListActivitiesParams{StartDate: "2016-09-16", AnchorCursor: cm.AnchorCursor{PerPage: 5, StartAfter: "b45b1d3f-3823-424f-ab47-5a1d0c00a7f6"}}) +api.MetricsListSubscriptions(&Cursor{}, "customerUUID") +api.MetricsListActivities(&Cursor{}, "customerUUID") api.MetricsCreateActivitiesExport(&cm.CreateMetricsActivitiesExportParam{StartDate: "2016-09-16",Type: "contraction"}) api.MetricsRetrieveActivitiesExport("activitiesExportUUID") diff --git a/chartmogul.go b/chartmogul.go index 82dafee..8308de8 100644 --- a/chartmogul.go +++ b/chartmogul.go @@ -122,9 +122,8 @@ type IApi interface { MetricsRetrieveLTV(metricsFilter *MetricsFilter) (*LTVResult, error) // Metrics - Subscriptions & Activities - MetricsListCustomerSubscriptions(cursor *Cursor, customerUUID string) (*MetricsCustomerSubscriptions, error) - MetricsListCustomerActivities(cursor *Cursor, customerUUID string) (*MetricsCustomerActivities, error) - MetricsListActivities(MetricsListActivitiesParams *MetricsListActivitiesParams) (*MetricsActivities, error) + MetricsListSubscriptions(cursor *Cursor, customerUUID string) (*MetricsSubscriptions, error) + MetricsListActivities(cursor *Cursor, customerUUID string) (*MetricsActivities, error) MetricsCreateActivitiesExport(CreateMetricsActivitiesExportParam *CreateMetricsActivitiesExportParam) (*MetricsActivitiesExport, error) MetricsRetrieveActivitiesExport(activitiesExportUUID string) (*MetricsActivitiesExport, error) @@ -146,13 +145,6 @@ type Cursor struct { PerPage uint32 `json:"per_page,omitempty"` } -// AnchorCursor contains query parameters for anchor based pagination used for some APIs in ChartMogul. -type AnchorCursor struct { - PerPage uint32 `json:"per-page,omitempty"` - //StartAfter is used to get the next set of Entries and its value should be the UUID of last Entry from previous response. - StartAfter string `json:"start-after,omitempty"` -} - // Errors contains error feedback from ChartMogul type Errors map[string]string diff --git a/integration_tests/connect_subscription_test.go b/integration_tests/connect_subscription_test.go index dbc7a7c..dcf5024 100644 --- a/integration_tests/connect_subscription_test.go +++ b/integration_tests/connect_subscription_test.go @@ -136,7 +136,7 @@ func TestConnectSubscriptions(t *testing.T) { t.Fatal(err) } //time.Sleep(time.Minute) - msubs, err := api.MetricsListCustomerSubscriptions(&cm.Cursor{PerPage: 200}, cus.UUID) + msubs, err := api.MetricsListSubscriptions(&cm.Cursor{PerPage: 200}, cus.UUID) if err != nil { t.Fatal(err) } diff --git a/metrics_activities.go b/metrics_activities.go index 44f629b..e574565 100644 --- a/metrics_activities.go +++ b/metrics_activities.go @@ -1,21 +1,18 @@ package chartmogul +import "strings" + // MetricsActivity represents Metrics API activity in ChartMogul. type MetricsActivity struct { - Date string `json:"date"` - ActivityArr float64 `json:"activity-arr"` - ActivityMrr float64 `json:"activity-mrr"` - ActivityMrrMovement float64 `json:"activity-mrr-movement"` - Currency string `json:"currency"` - Description string `json:"description"` - Type string `json:"type"` - SubscriptionExternalID string `json:"subscription-external-id"` - PlanExternalID string `json:"plan-external-id"` - CustomerName string `json:"customer-name"` - CustomerUUID string `json:"customer-uuid"` - CustomerExternalID string `json:"customer-external-id"` - BillingConnectorUUID string `json:"billing-connector-uuid"` - UUID string `json:"uuid"` + ID uint64 `json:"id"` + Date string `json:"date"` + ActivityArr float64 `json:"activity-arr"` + ActivityMrr float64 `json:"activity-mrr"` + ActivityMrrMovement float64 `json:"activity-mrr-movement"` + Currency string `json:"currency"` + CurrencySign string `json:"currency-sign"` + Description string `json:"description"` + Type string `json:"type"` } // MetricsActivities is the result of listing activities in Metrics API. @@ -23,24 +20,20 @@ type MetricsActivities struct { Entries []*MetricsActivity `json:"entries"` HasMore bool `json:"has_more"` PerPage uint32 `json:"per_page"` + Page uint32 `json:"page"` } -type MetricsListActivitiesParams struct { - Type string `json:"type,omitempty"` - StartDate string `json:"start-date,omitempty"` - EndDate string `json:"end-date,omitempty"` - Order string `json:"order,omitempty"` - AnchorCursor -} - -const metricsActivitiesEndpoint = "activities" +const metricsActivitiesEndpoint = "customers/:uuid/activities" -// MetricsListActivities lists all activities for an account -func (api API) MetricsListActivities(listActivitiesParams *MetricsListActivitiesParams) (*MetricsActivities, error) { +// MetricsListActivities lists all activities for cutomer of a given UUID. +// +// See https://dev.chartmogul.com/v1.0/reference#list-customer-activities +func (api API) MetricsListActivities(cursor *Cursor, customerUUID string) (*MetricsActivities, error) { result := &MetricsActivities{} + path := strings.Replace(metricsActivitiesEndpoint, ":uuid", customerUUID, 1) query := make([]interface{}, 0, 1) - if listActivitiesParams != nil { - query = append(query, *listActivitiesParams) + if cursor != nil { + query = append(query, *cursor) } - return result, api.list(metricsActivitiesEndpoint, result, query...) + return result, api.list(path, result, query...) } diff --git a/metrics_activities_test.go b/metrics_activities_test.go deleted file mode 100644 index 9d24426..0000000 --- a/metrics_activities_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package chartmogul - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/davecgh/go-spew/spew" -) - -// Test list activities tests. -func TestListActivities(t *testing.T) { - server := httptest.NewServer( - http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - if r.Method != "GET" { - t.Errorf("Unexpected method %v", r.Method) - } - if r.RequestURI != "/v/activities?per-page=5&start-after=b45b1d3f-3823-424f-ab47-5a1d0c00a7f6&type=new_biz" { - t.Errorf("Unexpected URI %v", r.RequestURI) - } - w.WriteHeader(http.StatusOK) - //nolint - w.Write([]byte(`{"entries": [{ - "description": "purchased the plan_11 plan", - "activity-mrr-movement": 6000, - "activity-mrr": 6000, - "activity-arr": 72000, - "date": "2020-05-06T01:00:00", - "type": "new_biz", - "currency": "USD", - "subscription-external-id": "sub_2", - "plan-external-id": "11", - "customer-name": "customer_2", - "customer-uuid": "8bc55ab6-c3b5-11eb-ac45-2f9a49d75af7", - "customer-external-id": "customer_2", - "billing-connector-uuid": "99076cb8-97a1-11eb-8798-a73b507e7929", - "uuid": "f1a49735-21c7-4e3f-9ddc-67927aaadcf4" - }], - "has_more": false, - "per_page": 200}`)) - })) - defer server.Close() - SetURL(server.URL + "/v/%v") - - var tested IApi = &API{ - AccountToken: "token", - AccessKey: "key", - } - activities, err := tested.MetricsListActivities(&MetricsListActivitiesParams{Type: "new_biz", AnchorCursor: AnchorCursor{PerPage: 5, StartAfter: "b45b1d3f-3823-424f-ab47-5a1d0c00a7f6"}}) - - if err != nil { - spew.Dump(err) - t.Fatal("Not expected to fail") - } - if len(activities.Entries) == 0 || - activities.Entries[0].UUID != "f1a49735-21c7-4e3f-9ddc-67927aaadcf4" { - spew.Dump(activities) - t.Fatal("Unexpected result") - } -} diff --git a/metrics_customer_activities.go b/metrics_customer_activities.go deleted file mode 100644 index 890cabf..0000000 --- a/metrics_customer_activities.go +++ /dev/null @@ -1,39 +0,0 @@ -package chartmogul - -import "strings" - -// MetricsCustomerActivity represents Metrics API activity in ChartMogul. -type MetricsCustomerActivity struct { - ID uint64 `json:"id"` - Date string `json:"date"` - ActivityArr float64 `json:"activity-arr"` - ActivityMrr float64 `json:"activity-mrr"` - ActivityMrrMovement float64 `json:"activity-mrr-movement"` - Currency string `json:"currency"` - CurrencySign string `json:"currency-sign"` - Description string `json:"description"` - Type string `json:"type"` -} - -// MetricsCustomerActivities is the result of listing activities in Metrics API. -type MetricsCustomerActivities struct { - Entries []*MetricsCustomerActivity `json:"entries"` - HasMore bool `json:"has_more"` - PerPage uint32 `json:"per_page"` - Page uint32 `json:"page"` -} - -const metricsCustomerActivitiesEndpoint = "customers/:uuid/activities" - -// MetricsListCustomerActivities lists all activities for cutomer of a given UUID. -// -// See https://dev.chartmogul.com/v1.0/reference#list-customer-activities -func (api API) MetricsListCustomerActivities(cursor *Cursor, customerUUID string) (*MetricsCustomerActivities, error) { - result := &MetricsCustomerActivities{} - path := strings.Replace(metricsCustomerActivitiesEndpoint, ":uuid", customerUUID, 1) - query := make([]interface{}, 0, 1) - if cursor != nil { - query = append(query, *cursor) - } - return result, api.list(path, result, query...) -} diff --git a/metrics_customer_activities_test.go b/metrics_customer_activities_test.go deleted file mode 100644 index 36a49dc..0000000 --- a/metrics_customer_activities_test.go +++ /dev/null @@ -1,58 +0,0 @@ -package chartmogul - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/davecgh/go-spew/spew" -) - -// Test list activities tests. -func TestListCustomerActivities(t *testing.T) { - server := httptest.NewServer( - http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - if r.Method != "GET" { - t.Errorf("Unexpected method %v", r.Method) - } - if r.RequestURI != "/v/customers/cus_8bc55ab6-c3b5-11eb-ac45-2f9a49d75af7/activities" { - t.Errorf("Unexpected URI %v", r.RequestURI) - } - w.WriteHeader(http.StatusOK) - //nolint - w.Write([]byte(`{"entries": [{ - "activity-arr": 24000, - "activity-mrr": 2000, - "activity-mrr-movement": 2000, - "currency": "USD", - "currency-sign": "$", - "date": "2015-06-09T13:16:00+00:00", - "description": "purchased the Silver Monthly plan (1)", - "id": 48730, - "type": "new_biz", - "subscription-external-id": "1" - }], - "has_more": false, - "per_page": 200, - "page": 1}`)) - })) - defer server.Close() - SetURL(server.URL + "/v/%v") - - var tested IApi = &API{ - AccountToken: "token", - AccessKey: "key", - } - activities, err := tested.MetricsListCustomerActivities(&Cursor{}, "cus_8bc55ab6-c3b5-11eb-ac45-2f9a49d75af7") - - if err != nil { - spew.Dump(err) - t.Fatal("Not expected to fail") - } - if len(activities.Entries) == 0 || - activities.Entries[0].Date != "2015-06-09T13:16:00+00:00" { - spew.Dump(activities) - t.Fatal("Unexpected result") - } -} diff --git a/metrics_customer_subscriptions.go b/metrics_customer_subscriptions.go deleted file mode 100644 index 3e923b6..0000000 --- a/metrics_customer_subscriptions.go +++ /dev/null @@ -1,43 +0,0 @@ -package chartmogul - -import "strings" - -// MetricsCustomerSubscription represents Metrics API subscription in ChartMogul. -type MetricsCustomerSubscription struct { - ID uint64 `json:"id"` - ExternalID string `json:"external_id"` - Plan string `json:"plan"` - Quantity uint32 `json:"quantity"` - BillingCycleCount uint32 `json:"billing-cycle-count"` - MRR float64 `json:"mrr"` - ARR float64 `json:"arr"` - Status string `json:"status"` - BillingCycle string `json:"billing-cycle"` - StartDate string `json:"start-date"` - EndDate string `json:"end-date"` - Currency string `json:"currency"` - CurrencySign string `json:"currency-sign"` -} - -// MetricsCustomerSubscriptions is the result of listing subscriptions in Metrics API. -type MetricsCustomerSubscriptions struct { - Entries []*MetricsCustomerSubscription `json:"entries"` - HasMore bool `json:"has_more"` - PerPage uint32 `json:"per_page"` - Page uint32 `json:"page"` -} - -const metricsCustomerSubscriptionsEndpoint = "customers/:uuid/subscriptions" - -// MetricsListCustomerSubscriptions lists all subscriptions for cutomer of a given UUID. -// -// See https://dev.chartmogul.com/v1.0/reference#list-customer-subscriptions -func (api API) MetricsListCustomerSubscriptions(cursor *Cursor, customerUUID string) (*MetricsCustomerSubscriptions, error) { - result := &MetricsCustomerSubscriptions{} - path := strings.Replace(metricsCustomerSubscriptionsEndpoint, ":uuid", customerUUID, 1) - query := make([]interface{}, 0, 1) - if cursor != nil { - query = append(query, *cursor) - } - return result, api.list(path, result, query...) -} diff --git a/metrics_customer_subscriptions_test.go b/metrics_customer_subscriptions_test.go deleted file mode 100644 index 015d95f..0000000 --- a/metrics_customer_subscriptions_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package chartmogul - -import ( - "net/http" - "net/http/httptest" - "testing" - - "github.com/davecgh/go-spew/spew" -) - -// Test list activities tests. -func TestListCustomerSubscriptions(t *testing.T) { - server := httptest.NewServer( - http.HandlerFunc( - func(w http.ResponseWriter, r *http.Request) { - if r.Method != "GET" { - t.Errorf("Unexpected method %v", r.Method) - } - if r.RequestURI != "/v/customers/cus_8bc55ab6-c3b5-11eb-ac45-2f9a49d75af7/subscriptions" { - t.Errorf("Unexpected URI %v", r.RequestURI) - } - w.WriteHeader(http.StatusOK) - //nolint - w.Write([]byte(`{"entries": [{ - "id": 9306830, - "external_id": "sub_0001", - "plan": "PRO Plan (10,000 active cust.) monthly", - "quantity": 1, - "mrr": 70800, - "arr": 849600, - "status": "active", - "billing-cycle": "month", - "billing-cycle-count": 1, - "start-date": "2015-12-20T08:26:49-05:00", - "end-date": "2016-03-20T09:26:49-05:00", - "currency": "USD", - "currency-sign": "$" - }], - "has_more": false, - "per_page": 200, - "page": 1}`)) - })) - defer server.Close() - SetURL(server.URL + "/v/%v") - - var tested IApi = &API{ - AccountToken: "token", - AccessKey: "key", - } - activities, err := tested.MetricsListCustomerSubscriptions(&Cursor{}, "cus_8bc55ab6-c3b5-11eb-ac45-2f9a49d75af7") - - if err != nil { - spew.Dump(err) - t.Fatal("Not expected to fail") - } - if len(activities.Entries) == 0 || - activities.Entries[0].ExternalID != "sub_0001" { - spew.Dump(activities) - t.Fatal("Unexpected result") - } -} diff --git a/metrics_subscriptions.go b/metrics_subscriptions.go new file mode 100644 index 0000000..0be7991 --- /dev/null +++ b/metrics_subscriptions.go @@ -0,0 +1,43 @@ +package chartmogul + +import "strings" + +// MetricsSubscription represents Metrics API subscription in ChartMogul. +type MetricsSubscription struct { + ID uint64 `json:"id"` + ExternalID string `json:"external_id"` + Plan string `json:"plan"` + Quantity uint32 `json:"quantity"` + BillingCycleCount uint32 `json:"billing-cycle-count"` + MRR float64 `json:"mrr"` + ARR float64 `json:"arr"` + Status string `json:"status"` + BillingCycle string `json:"billing-cycle"` + StartDate string `json:"start-date"` + EndDate string `json:"end-date"` + Currency string `json:"currency"` + CurrencySign string `json:"currency-sign"` +} + +// MetricsSubscriptions is the result of listing subscriptions in Metrics API. +type MetricsSubscriptions struct { + Entries []*MetricsSubscription `json:"entries"` + HasMore bool `json:"has_more"` + PerPage uint32 `json:"per_page"` + Page uint32 `json:"page"` +} + +const metricsSubscriptionsEndpoint = "customers/:uuid/subscriptions" + +// MetricsListSubscriptions lists all subscriptions for cutomer of a given UUID. +// +// See https://dev.chartmogul.com/v1.0/reference#list-customer-subscriptions +func (api API) MetricsListSubscriptions(cursor *Cursor, customerUUID string) (*MetricsSubscriptions, error) { + result := &MetricsSubscriptions{} + path := strings.Replace(metricsSubscriptionsEndpoint, ":uuid", customerUUID, 1) + query := make([]interface{}, 0, 1) + if cursor != nil { + query = append(query, *cursor) + } + return result, api.list(path, result, query...) +} diff --git a/mock_chartmogul/chartmogul.go b/mock_chartmogul/chartmogul.go index 0e8c5c5..c0d0ee3 100644 --- a/mock_chartmogul/chartmogul.go +++ b/mock_chartmogul/chartmogul.go @@ -474,49 +474,49 @@ func (mr *MockIApiMockRecorder) MergeCustomers(arg0 interface{}) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MergeCustomers", reflect.TypeOf((*MockIApi)(nil).MergeCustomers), arg0) } -// MetricsListActivities mocks base method -func (m *MockIApi) MetricsListActivities(arg0 *chartmogul.MetricsListActivitiesParams) (*chartmogul.MetricsActivities, error) { +// MetricsCreateActivitiesExport mocks base method +func (m *MockIApi) MetricsCreateActivitiesExport(arg0 *chartmogul.CreateMetricsActivitiesExportParam) (*chartmogul.MetricsActivitiesExport, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MetricsListActivities", arg0) - ret0, _ := ret[0].(*chartmogul.MetricsActivities) + ret := m.ctrl.Call(m, "MetricsCreateActivitiesExport", arg0) + ret0, _ := ret[0].(*chartmogul.MetricsActivitiesExport) ret1, _ := ret[1].(error) return ret0, ret1 } -// MetricsListActivities indicates an expected call of MetricsListActivities -func (mr *MockIApiMockRecorder) MetricsListActivities(arg0 interface{}) *gomock.Call { +// MetricsCreateActivitiesExport indicates an expected call of MetricsCreateActivitiesExport +func (mr *MockIApiMockRecorder) MetricsCreateActivitiesExport(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MetricsListActivities", reflect.TypeOf((*MockIApi)(nil).MetricsListActivities), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MetricsCreateActivitiesExport", reflect.TypeOf((*MockIApi)(nil).MetricsCreateActivitiesExport), arg0) } -// MetricsListCustomerActivities mocks base method -func (m *MockIApi) MetricsListCustomerActivities(arg0 *chartmogul.Cursor, arg1 string) (*chartmogul.MetricsCustomerActivities, error) { +// MetricsListActivities mocks base method +func (m *MockIApi) MetricsListActivities(arg0 *chartmogul.Cursor, arg1 string) (*chartmogul.MetricsActivities, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MetricsListCustomerActivities", arg0, arg1) - ret0, _ := ret[0].(*chartmogul.MetricsCustomerActivities) + ret := m.ctrl.Call(m, "MetricsListActivities", arg0, arg1) + ret0, _ := ret[0].(*chartmogul.MetricsActivities) ret1, _ := ret[1].(error) return ret0, ret1 } -// MetricsListCustomerActivities indicates an expected call of MetricsListCustomerActivities -func (mr *MockIApiMockRecorder) MetricsListCustomerActivities(arg0, arg1 interface{}) *gomock.Call { +// MetricsListActivities indicates an expected call of MetricsListActivities +func (mr *MockIApiMockRecorder) MetricsListActivities(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MetricsListCustomerActivities", reflect.TypeOf((*MockIApi)(nil).MetricsListCustomerActivities), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MetricsListActivities", reflect.TypeOf((*MockIApi)(nil).MetricsListActivities), arg0, arg1) } -// MetricsListCustomerSubscriptions mocks base method -func (m *MockIApi) MetricsListCustomerSubscriptions(arg0 *chartmogul.Cursor, arg1 string) (*chartmogul.MetricsCustomerSubscriptions, error) { +// MetricsListSubscriptions mocks base method +func (m *MockIApi) MetricsListSubscriptions(arg0 *chartmogul.Cursor, arg1 string) (*chartmogul.MetricsSubscriptions, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "MetricsListCustomerSubscriptions", arg0, arg1) - ret0, _ := ret[0].(*chartmogul.MetricsCustomerSubscriptions) + ret := m.ctrl.Call(m, "MetricsListSubscriptions", arg0, arg1) + ret0, _ := ret[0].(*chartmogul.MetricsSubscriptions) ret1, _ := ret[1].(error) return ret0, ret1 } -// MetricsListCustomerSubscriptions indicates an expected call of MetricsListCustomerSubscriptions -func (mr *MockIApiMockRecorder) MetricsListCustomerSubscriptions(arg0, arg1 interface{}) *gomock.Call { +// MetricsListSubscriptions indicates an expected call of MetricsListSubscriptions +func (mr *MockIApiMockRecorder) MetricsListSubscriptions(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MetricsListCustomerSubscriptions", reflect.TypeOf((*MockIApi)(nil).MetricsListCustomerSubscriptions), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MetricsListSubscriptions", reflect.TypeOf((*MockIApi)(nil).MetricsListSubscriptions), arg0, arg1) } // MetricsRetrieveARPA mocks base method @@ -564,6 +564,21 @@ func (mr *MockIApiMockRecorder) MetricsRetrieveASP(arg0 interface{}) *gomock.Cal return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MetricsRetrieveASP", reflect.TypeOf((*MockIApi)(nil).MetricsRetrieveASP), arg0) } +// MetricsRetrieveActivitiesExport mocks base method +func (m *MockIApi) MetricsRetrieveActivitiesExport(arg0 string) (*chartmogul.MetricsActivitiesExport, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MetricsRetrieveActivitiesExport", arg0) + ret0, _ := ret[0].(*chartmogul.MetricsActivitiesExport) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MetricsRetrieveActivitiesExport indicates an expected call of MetricsRetrieveActivitiesExport +func (mr *MockIApiMockRecorder) MetricsRetrieveActivitiesExport(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MetricsRetrieveActivitiesExport", reflect.TypeOf((*MockIApi)(nil).MetricsRetrieveActivitiesExport), arg0) +} + // MetricsRetrieveAll mocks base method func (m *MockIApi) MetricsRetrieveAll(arg0 *chartmogul.MetricsFilter) (*chartmogul.MetricsResult, error) { m.ctrl.T.Helper()