Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
81 changed files
with
5,739 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import getJsonResponse from "../../helpers/getJsonResponse"; | ||
import Service from "../../service"; | ||
import { AccountHolder, AccountHolderInfo, ObjectSerializer, PaginatedBalanceAccountsResponse } from "../../typings/balancePlatform/models"; | ||
import { IRequest } from "../../typings/requestOptions"; | ||
import BalancePlatformResource from "../resource/balancePlaftformResource"; | ||
|
||
// @TODO PW-7013: make this change at the spec level? | ||
export type AccountHolderUpdate = Omit<AccountHolder, 'id'>; | ||
|
||
class AccountHolders extends Service { | ||
public async create(request: AccountHolderInfo): Promise<AccountHolder> { | ||
const resource = new BalancePlatformResource(this, `/accountHolders`); | ||
const response = await getJsonResponse<AccountHolderInfo, AccountHolder>( | ||
resource, | ||
request, | ||
{ method: "POST" } | ||
); | ||
return ObjectSerializer.deserialize(response, "AccountHolder"); | ||
} | ||
|
||
public async retrieve(id: string): Promise<AccountHolder> { | ||
const resource = new BalancePlatformResource(this, `/accountHolders/${id}`); | ||
const response = await getJsonResponse<string, AccountHolder>( | ||
resource, | ||
'', | ||
{ method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "AccountHolder"); | ||
} | ||
|
||
public async update(id: string, request: AccountHolderUpdate): Promise<AccountHolder> { | ||
const resource = new BalancePlatformResource(this, `/accountHolders/${id}`); | ||
const response = await getJsonResponse<AccountHolderUpdate, AccountHolder>( | ||
resource, | ||
request, | ||
{ method: "PATCH" } | ||
); | ||
return ObjectSerializer.deserialize(response, "AccountHolder"); | ||
} | ||
|
||
public async listBalanceAccounts(id: string, requestOptions?: IRequest.Options): Promise<PaginatedBalanceAccountsResponse> { | ||
const resource = new BalancePlatformResource(this, `/accountHolders/${id}/balanceAccounts`); | ||
const response = await getJsonResponse<string, PaginatedBalanceAccountsResponse>( | ||
resource, | ||
'', | ||
{ ...requestOptions, method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "PaginatedBalanceAccountsResponse"); | ||
} | ||
} | ||
|
||
export default AccountHolders; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import getJsonResponse from "../../helpers/getJsonResponse"; | ||
import Service from "../../service"; | ||
import { BalanceAccount, BalanceAccountInfo, BalanceAccountUpdateRequest, BalanceSweepConfigurationsResponse, ObjectSerializer, PaginatedPaymentInstrumentsResponse, SweepConfigurationV2 } from "../../typings/balancePlatform/models"; | ||
import { IRequest } from "../../typings/requestOptions"; | ||
import BalancePlatformResource from "../resource/balancePlaftformResource"; | ||
|
||
// @TODO PW-7013: make this change at the spec level? | ||
export type SweepConfigurationV2Create = Omit<SweepConfigurationV2, 'id'>; | ||
export type SweepConfigurationV2Update = Partial<SweepConfigurationV2>; | ||
|
||
class BalanceAccounts extends Service { | ||
public async create(request: BalanceAccountInfo): Promise<BalanceAccount> { | ||
const resource = new BalancePlatformResource(this, `/balanceAccounts`); | ||
const response = await getJsonResponse<BalanceAccountInfo, BalanceAccount>( | ||
resource, | ||
request, | ||
{ method: "POST" } | ||
); | ||
return ObjectSerializer.deserialize(response, "BalanceAccount"); | ||
} | ||
|
||
public async listSweeps(balanceAccountId: string, requestOptions?: IRequest.Options): Promise<BalanceSweepConfigurationsResponse> { | ||
const resource = new BalancePlatformResource(this, `/balanceAccounts/${balanceAccountId}/sweeps`); | ||
const response = await getJsonResponse<string, BalanceSweepConfigurationsResponse>( | ||
resource, | ||
'', | ||
{ method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "BalanceSweepConfigurationsResponse"); | ||
} | ||
|
||
public async createSweep(balanceAccountId: string, request: SweepConfigurationV2Create): Promise<SweepConfigurationV2> { | ||
const resource = new BalancePlatformResource(this, `/balanceAccounts/${balanceAccountId}/sweeps`); | ||
const response = await getJsonResponse<SweepConfigurationV2Create, SweepConfigurationV2>( | ||
resource, | ||
request, | ||
{ method: "POST" } | ||
); | ||
return ObjectSerializer.deserialize(response, "SweepConfigurationV2"); | ||
} | ||
|
||
public async deleteSweep(balanceAccountId: string, sweepId: string): Promise<void> { | ||
const resource = new BalancePlatformResource(this, `/balanceAccounts/${balanceAccountId}/sweeps/${sweepId}`); | ||
await getJsonResponse<string, string>( | ||
resource, | ||
'', | ||
{ method: "DELETE" } | ||
); | ||
} | ||
|
||
public async retrieveSweep(balanceAccountId: string, sweepId: string): Promise<SweepConfigurationV2> { | ||
const resource = new BalancePlatformResource(this, `/balanceAccounts/${balanceAccountId}/sweeps/${sweepId}`); | ||
const response = await getJsonResponse<string, SweepConfigurationV2>( | ||
resource, | ||
'', | ||
{ method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "SweepConfigurationV2"); | ||
} | ||
|
||
public async updateSweep(balanceAccountId: string, sweepId: string, request: SweepConfigurationV2Update): Promise<SweepConfigurationV2> { | ||
const resource = new BalancePlatformResource(this, `/balanceAccounts/${balanceAccountId}/sweeps/${sweepId}`); | ||
const response = await getJsonResponse<SweepConfigurationV2Update, SweepConfigurationV2>( | ||
resource, | ||
request, | ||
{ method: "PATCH" } | ||
); | ||
return ObjectSerializer.deserialize(response, "SweepConfigurationV2"); | ||
} | ||
|
||
public async retrieve(id: string): Promise<BalanceAccount> { | ||
const resource = new BalancePlatformResource(this, `/balanceAccounts/${id}`); | ||
const response = await getJsonResponse<string, BalanceAccount>( | ||
resource, | ||
'', | ||
{ method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "BalanceAccount"); | ||
} | ||
|
||
public async update(id: string, request: BalanceAccountUpdateRequest): Promise<BalanceAccount> { | ||
const resource = new BalancePlatformResource(this, `/balanceAccounts/${id}`); | ||
const response = await getJsonResponse<BalanceAccountUpdateRequest, BalanceAccount>( | ||
resource, | ||
request, | ||
{ method: "PATCH" } | ||
); | ||
return ObjectSerializer.deserialize(response, "BalanceAccount"); | ||
} | ||
|
||
public async listPaymentInstruments(id: string, requestOptions?: IRequest.Options): Promise<PaginatedPaymentInstrumentsResponse> { | ||
const resource = new BalancePlatformResource(this, `/balanceAccounts/${id}/paymentInstruments`); | ||
const response = await getJsonResponse<string, PaginatedPaymentInstrumentsResponse>( | ||
resource, | ||
'', | ||
{ ...requestOptions, method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "PaginatedPaymentInstrumentsResponse"); | ||
} | ||
|
||
} | ||
|
||
export default BalanceAccounts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import getJsonResponse from "../../helpers/getJsonResponse"; | ||
import Service from "../../service"; | ||
import { BalancePlatform, ObjectSerializer, PaginatedAccountHoldersResponse } from "../../typings/balancePlatform/models"; | ||
import { IRequest } from "../../typings/requestOptions"; | ||
import BalancePlatformResource from "../resource/balancePlaftformResource"; | ||
|
||
class General extends Service { | ||
public async retrieve(id: string): Promise<BalancePlatform> { | ||
const resource = new BalancePlatformResource(this, `/balancePlatforms/${id}`); | ||
const response = await getJsonResponse<string, BalancePlatform>( | ||
resource, | ||
'', | ||
{ method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "BalancePlatform"); | ||
} | ||
|
||
public async listAccountHolders(id: string, requestOptions?: IRequest.Options): Promise<PaginatedAccountHoldersResponse> { | ||
const resource = new BalancePlatformResource(this, `/balancePlatforms/${id}/accountHolders`); | ||
const response = await getJsonResponse<string, PaginatedAccountHoldersResponse>( | ||
resource, | ||
'', | ||
{ ...requestOptions, method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "PaginatedAccountHoldersResponse"); | ||
} | ||
} | ||
|
||
export default General; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import getJsonResponse from "../../helpers/getJsonResponse"; | ||
import Service from "../../service"; | ||
import { ObjectSerializer, PaymentInstrumentGroup, PaymentInstrumentGroupInfo, TransactionRulesResponse } from "../../typings/balancePlatform/models"; | ||
import BalancePlatformResource from "../resource/balancePlaftformResource"; | ||
|
||
class PaymentInstrumentGroups extends Service { | ||
public async create(request: PaymentInstrumentGroupInfo): Promise<PaymentInstrumentGroup> { | ||
const resource = new BalancePlatformResource(this, `/paymentInstrumentGroups`); | ||
const response = await getJsonResponse<PaymentInstrumentGroupInfo, PaymentInstrumentGroup>( | ||
resource, | ||
request, | ||
{ method: "POST" } | ||
); | ||
return ObjectSerializer.deserialize(response, "PaymentInstrumentGroup"); | ||
} | ||
|
||
public async retrieve(id: string): Promise<PaymentInstrumentGroup> { | ||
const resource = new BalancePlatformResource(this, `/paymentInstrumentGroups/${id}`); | ||
const response = await getJsonResponse<string, PaymentInstrumentGroup>( | ||
resource, | ||
"", | ||
{ method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "PaymentInstrumentGroup"); | ||
} | ||
|
||
public async listTransactionRules(id: string): Promise<TransactionRulesResponse> { | ||
const resource = new BalancePlatformResource(this, `/paymentInstrumentGroups/${id}/transactionRules`); | ||
const response = await getJsonResponse<string, TransactionRulesResponse>( | ||
resource, | ||
"", | ||
{ method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "TransactionRulesResponse"); | ||
} | ||
} | ||
|
||
export default PaymentInstrumentGroups; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import getJsonResponse from "../../helpers/getJsonResponse"; | ||
import Service from "../../service"; | ||
import { ObjectSerializer, PaymentInstrument, PaymentInstrumentInfo, PaymentInstrumentUpdateRequest, TransactionRulesResponse } from "../../typings/balancePlatform/models"; | ||
import BalancePlatformResource from "../resource/balancePlaftformResource"; | ||
|
||
class PaymentInstruments extends Service { | ||
public async create(request: PaymentInstrumentInfo): Promise<PaymentInstrument> { | ||
const resource = new BalancePlatformResource(this, `/paymentInstruments`); | ||
const response = await getJsonResponse<PaymentInstrumentInfo, PaymentInstrument>( | ||
resource, | ||
request, | ||
{ method: "POST" } | ||
); | ||
return ObjectSerializer.deserialize(response, "PaymentInstrument"); | ||
} | ||
|
||
public async retrieve(id: string): Promise<PaymentInstrument> { | ||
const resource = new BalancePlatformResource(this, `/paymentInstruments/${id}`); | ||
const response = await getJsonResponse<string, PaymentInstrument>( | ||
resource, | ||
'', | ||
{ method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "PaymentInstrument"); | ||
} | ||
|
||
public async update(id: string, request: PaymentInstrumentUpdateRequest): Promise<PaymentInstrument> { | ||
const resource = new BalancePlatformResource(this, `/paymentInstruments/${id}`); | ||
const response = await getJsonResponse<PaymentInstrumentUpdateRequest, PaymentInstrument>( | ||
resource, | ||
request, | ||
{ method: "PATCH" } | ||
); | ||
return ObjectSerializer.deserialize(response, "PaymentInstrument"); | ||
} | ||
|
||
public async listTransactionRules(id: string): Promise<TransactionRulesResponse> { | ||
const resource = new BalancePlatformResource(this, `/paymentInstruments/${id}/transactionRules`); | ||
const response = await getJsonResponse<string, TransactionRulesResponse>( | ||
resource, | ||
'', | ||
{ method: "GET" } | ||
); | ||
return ObjectSerializer.deserialize(response, "TransactionRulesResponse"); | ||
} | ||
} | ||
|
||
export default PaymentInstruments; |
Oops, something went wrong.