Skip to content

Commit

Permalink
fix: revert using ecpApi in favor of customers Api
Browse files Browse the repository at this point in the history
  • Loading branch information
vladpoltorin committed Sep 8, 2023
1 parent b5b6958 commit 71d8194
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/resources/customers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
CustomerFeature,
CustomerPaymentGatewayCredentialInputArgs,
CustomersApi,
CustomerPortalApi,
CustomerUsage,
DeleteSubscriptionArgs,
PaymentGatewayCredential,
Expand All @@ -22,8 +21,8 @@ import {
BillingSettings,
SubscriptionAddOnItem,
CustomerStatus,
CustomerPortalInvoice,
CustomerPortalAccruedRevenue,
Invoice,
AccruedRevenue,
} from '../codegen';
import { Configuration as APIConfiguration } from '../codegen/runtime';
import { BaseResource } from './base';
Expand Down Expand Up @@ -57,12 +56,9 @@ const transformDate = (date?: Date | string) => {
class Customers extends BaseResource {
private api: CustomersApi;

private ecpApi: CustomerPortalApi;

constructor(apiConfig: APIConfiguration) {
super(apiConfig);
this.api = new CustomersApi(apiConfig);
this.ecpApi = new CustomerPortalApi(apiConfig);
}

/**
Expand Down Expand Up @@ -335,15 +331,23 @@ class Customers extends BaseResource {
}

public getCustomerInvoices(
customerName: string,
overrides?: RequestInit,
): Promise<CustomerPortalInvoice[]> {
return this.ecpApi.ecpInvoicesGet(overrides);
): Promise<Invoice[]> {
return this.api.customersCustomerNameInvoicesGet(
{ customerName },
overrides,
);
}

public getTotalAccrueRevenue(
customerName: string,
overrides?: RequestInit,
): Promise<CustomerPortalAccruedRevenue> {
return this.ecpApi.ecpTotalAccruedRevenueGet(overrides);
): Promise<AccruedRevenue> {
return this.api.customersCustomerNameTotalAccruedRevenueGet(
{ customerName },
overrides,
);
}
}

Expand Down

0 comments on commit 71d8194

Please sign in to comment.