wallet 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +309 -309
- package/.openapi-generator-ignore +23 -23
- package/api/advertisementCreditsApi.ts +589 -589
- package/api/analyticsApi.ts +5953 -5953
- package/api/apis.ts +86 -86
- package/api/appleWalletSubscribersApi.ts +235 -235
- package/api/billingApi.ts +680 -680
- package/api/clubMembersPointsApi.ts +798 -798
- package/api/configurationApi.ts +225 -225
- package/api/countriesApi.ts +155 -155
- package/api/customerApi.ts +737 -737
- package/api/dashboardApi.ts +1553 -1553
- package/api/dynamicVouchersApi.ts +603 -603
- package/api/employeeAccessApi.ts +165 -165
- package/api/employeesApi.ts +2933 -2933
- package/api/industriesApi.ts +155 -155
- package/api/infoGenesisReportsApi.ts +2023 -2023
- package/api/integratedTerminalsApi.ts +447 -447
- package/api/interactionsApi.ts +678 -678
- package/api/linkBookApi.ts +447 -447
- package/api/linkBookSectionApi.ts +447 -447
- package/api/loginAndLogoutApi.ts +296 -296
- package/api/membershipTiersApi.ts +729 -729
- package/api/merchantApi.ts +1534 -1534
- package/api/merchantCreditsApi.ts +798 -798
- package/api/merchantURLsApi.ts +586 -586
- package/api/mobileTerminalApi.ts +323 -323
- package/api/newsApi.ts +447 -447
- package/api/paymentDesignsApi.ts +519 -519
- package/api/performancesApi.ts +447 -447
- package/api/promoCodesApi.ts +447 -447
- package/api/sMSApi.ts +1999 -1999
- package/api/settingsApi.ts +220 -220
- package/api/staticVoucherCampaignGroupsApi.ts +165 -165
- package/api/staticVoucherCampaignsApi.ts +1484 -1484
- package/api/staticVouchersApi.ts +535 -535
- package/api/systemApi.ts +604 -604
- package/api/transactionLedgerApi.ts +203 -203
- package/api/utilitiesApi.ts +157 -157
- package/api/webTerminalApi.ts +309 -309
- package/api.ts +2 -2
- package/examples/advertisementcredits.example.ts +50 -50
- package/examples/clubmembers.example.ts +50 -50
- package/examples/linkbook.example.ts +50 -50
- package/examples/membershiptiers.example.ts +49 -49
- package/examples/merchanturls.example.ts +47 -47
- package/examples/news.example.ts +51 -51
- package/examples/paymentdesigns.example.ts +56 -56
- package/git_push.sh +57 -57
- package/model/advertisementCredit.ts +103 -103
- package/model/advertisementCreditBroadcast.ts +154 -154
- package/model/advertisementCreditScan.ts +170 -170
- package/model/agreement.ts +133 -133
- package/model/alert.ts +79 -79
- package/model/announcement.ts +67 -67
- package/model/applicableTerminals.ts +30 -30
- package/model/applicableTerminalsAnyOf.ts +17 -17
- package/model/applicableTerminalsAnyOf1.ts +17 -17
- package/model/applicableTerminalsAnyOf2.ts +17 -17
- package/model/applicableTerminalsAnyOf3.ts +17 -17
- package/model/authError.ts +55 -55
- package/model/availablePhoneNumbersRequest.ts +43 -43
- package/model/clickFunnelAmount.ts +37 -37
- package/model/clickFunnelContact.ts +248 -248
- package/model/clickFunnelContactProfile.ts +235 -235
- package/model/clickFunnelEvent.ts +38 -38
- package/model/clickFunnelOriginalAmount.ts +37 -37
- package/model/clickFunnelProduct.ts +194 -194
- package/model/clickFunnelPurchase.ts +178 -178
- package/model/createStaticVoucherCampaign.ts +109 -109
- package/model/createStaticVoucherCampaignWithVoucher.ts +109 -109
- package/model/createStaticVoucherCampaignWithVoucherWithCSV.ts +109 -109
- package/model/dashboardWidget.ts +115 -115
- package/model/duplicateRowFound.ts +55 -55
- package/model/dynamicVoucher.ts +224 -224
- package/model/dynamicVoucherBroadcast.ts +154 -154
- package/model/employee.ts +109 -109
- package/model/employeeActivityLog.ts +67 -67
- package/model/employeeAlert.ts +79 -79
- package/model/exportDataFile.ts +85 -85
- package/model/falsumError.ts +41 -41
- package/model/falsumField.ts +55 -55
- package/model/feature.ts +79 -79
- package/model/forbiddenRequest.ts +55 -55
- package/model/foreignKeyDoesNotExist.ts +55 -55
- package/model/helpDeskRequest.ts +85 -85
- package/model/importedList.ts +73 -73
- package/model/importedListRecipient.ts +73 -73
- package/model/inlineObject.ts +31 -31
- package/model/inlineObject1.ts +31 -31
- package/model/inlineObject10.ts +37 -37
- package/model/inlineObject11.ts +37 -37
- package/model/inlineObject12.ts +37 -37
- package/model/inlineObject13.ts +37 -37
- package/model/inlineObject14.ts +37 -37
- package/model/inlineObject15.ts +67 -67
- package/model/inlineObject16.ts +61 -61
- package/model/inlineObject17.ts +55 -55
- package/model/inlineObject18.ts +61 -61
- package/model/inlineObject19.ts +55 -55
- package/model/inlineObject2.ts +31 -31
- package/model/inlineObject20.ts +61 -61
- package/model/inlineObject21.ts +73 -73
- package/model/inlineObject22.ts +31 -31
- package/model/inlineObject23.ts +31 -31
- package/model/inlineObject24.ts +43 -43
- package/model/inlineObject25.ts +55 -55
- package/model/inlineObject26.ts +31 -31
- package/model/inlineObject27.ts +31 -31
- package/model/inlineObject28.ts +43 -43
- package/model/inlineObject29.ts +49 -49
- package/model/inlineObject3.ts +31 -31
- package/model/inlineObject30.ts +43 -43
- package/model/inlineObject31.ts +31 -31
- package/model/inlineObject32.ts +31 -31
- package/model/inlineObject33.ts +31 -31
- package/model/inlineObject34.ts +43 -43
- package/model/inlineObject35.ts +43 -43
- package/model/inlineObject36.ts +43 -43
- package/model/inlineObject37.ts +43 -43
- package/model/inlineObject38.ts +43 -43
- package/model/inlineObject39.ts +43 -43
- package/model/inlineObject4.ts +37 -37
- package/model/inlineObject40.ts +43 -43
- package/model/inlineObject41.ts +43 -43
- package/model/inlineObject42.ts +43 -43
- package/model/inlineObject43.ts +43 -43
- package/model/inlineObject44.ts +43 -43
- package/model/inlineObject45.ts +43 -43
- package/model/inlineObject46.ts +43 -43
- package/model/inlineObject47.ts +43 -43
- package/model/inlineObject48.ts +43 -43
- package/model/inlineObject49.ts +43 -43
- package/model/inlineObject5.ts +31 -31
- package/model/inlineObject50.ts +43 -43
- package/model/inlineObject51.ts +97 -97
- package/model/inlineObject52.ts +31 -31
- package/model/inlineObject53.ts +97 -97
- package/model/inlineObject54.ts +97 -97
- package/model/inlineObject55.ts +91 -91
- package/model/inlineObject56.ts +37 -37
- package/model/inlineObject57.ts +37 -37
- package/model/inlineObject58.ts +37 -37
- package/model/inlineObject59.ts +43 -43
- package/model/inlineObject6.ts +31 -31
- package/model/inlineObject60.ts +43 -43
- package/model/inlineObject61.ts +43 -43
- package/model/inlineObject62.ts +37 -37
- package/model/inlineObject63.ts +37 -37
- package/model/inlineObject64.ts +37 -37
- package/model/inlineObject65.ts +205 -205
- package/model/inlineObject66.ts +49 -49
- package/model/inlineObject67.ts +49 -49
- package/model/inlineObject68.ts +37 -37
- package/model/inlineObject69.ts +121 -121
- package/model/inlineObject7.ts +31 -31
- package/model/inlineObject8.ts +43 -43
- package/model/inlineObject9.ts +37 -37
- package/model/inlineResponse200.ts +37 -37
- package/model/inlineResponse2001.ts +56 -56
- package/model/inlineResponse20010.ts +109 -109
- package/model/inlineResponse20011.ts +43 -43
- package/model/inlineResponse2002.ts +31 -31
- package/model/inlineResponse2003.ts +31 -31
- package/model/inlineResponse2004.ts +43 -43
- package/model/inlineResponse2005.ts +38 -38
- package/model/inlineResponse2006.ts +97 -97
- package/model/inlineResponse2007.ts +44 -44
- package/model/inlineResponse2008.ts +31 -31
- package/model/inlineResponse2009.ts +98 -98
- package/model/internalServerError.ts +55 -55
- package/model/ledgerEntry.ts +176 -176
- package/model/linkBook.ts +85 -85
- package/model/linkBookSection.ts +61 -61
- package/model/mSMemberHistory.ts +112 -112
- package/model/mSMemberHistoryPagination.ts +53 -53
- package/model/mSMemberRedemption.ts +109 -109
- package/model/mSMemberRedemptionPagination.ts +53 -53
- package/model/mSMembershipTierHistory.ts +106 -106
- package/model/mSMembershipTierHistoryPagination.ts +53 -53
- package/model/mSMembershipTierRedemption.ts +121 -121
- package/model/mSMembershipTierRedemptionPagination.ts +53 -53
- package/model/mSMerchantCreditHistory.ts +88 -88
- package/model/mSMerchantCreditHistoryPagination.ts +53 -53
- package/model/mSMerchantCreditRedemption.ts +109 -109
- package/model/mSMerchantCreditRedemptionPagination.ts +53 -53
- package/model/mediaFile.ts +85 -85
- package/model/member.ts +118 -118
- package/model/memberSearch.ts +61 -61
- package/model/merchant.ts +133 -133
- package/model/merchantCreditSearch.ts +61 -61
- package/model/merchantNotInitialized.ts +55 -55
- package/model/merchantURL.ts +67 -67
- package/model/message.ts +74 -74
- package/model/models.ts +1015 -1015
- package/model/moduleError.ts +157 -157
- package/model/newsArticle.ts +85 -85
- package/model/optInList.ts +121 -121
- package/model/optInListSource.ts +73 -73
- package/model/optInListSubscriber.ts +104 -104
- package/model/outboundSMS.ts +157 -157
- package/model/paginatedWTMembers.ts +53 -53
- package/model/paginatedWTMerchantCredits.ts +53 -53
- package/model/paginationRequestWithSortOptions.ts +75 -75
- package/model/paymentDesign.ts +139 -139
- package/model/performance.ts +100 -100
- package/model/phoneNumber.ts +157 -157
- package/model/pickCreateStaticVoucherCampaignWithVoucherExcludeKeyofcreateStaticVoucherCampaignWithVoucherSourceID.ts +106 -106
- package/model/pickMSMemberCreationParamsExcludeKeyofMSMemberCreationParamsMemberIdentifier.ts +67 -67
- package/model/pickMSMemberExcludeKeyofMSMemberMemberIdentifier.ts +106 -106
- package/model/pickMSMerchantCreditCreationParamsExcludeKeyofMSMerchantCreditCreationParamsMemberIdentifier.ts +43 -43
- package/model/pickMSMerchantCreditExcludeKeyofMSMerchantCreditMemberIdentifier.ts +82 -82
- package/model/pickPaginationRequestWithoutSortOptionsExcludeKeyofPaginationRequestWithoutSortOptionsIsArchiveIncluded.ts +46 -46
- package/model/pickSSImportedListUpdateParamsExcludeKeyofSSImportedListUpdateParamsId.ts +52 -52
- package/model/pickSSMobileNumberUpdateParamsExcludeKeyofSSMobileNumberUpdateParamsId.ts +100 -100
- package/model/pickSSOptInListCreateParamsExcludeKeyofSSOptInListCreateParamsEmployeeID.ts +94 -94
- package/model/pickSSOptInListUpdateParamsExcludeKeyofSSOptInListUpdateParamsId.ts +100 -100
- package/model/pickSSOptInSourceUpdateParamsExcludeKeyofSSOptInSourceUpdateParamsId.ts +46 -46
- package/model/pickSSOutboundMessageLogExcludeKeyofSSOutboundMessageLogToCellPhone.ts +154 -154
- package/model/pickVSAdvertisementCreditScanExcludeKeyofVSAdvertisementCreditScanRedeemedAtOrRefundedAt.ts +137 -137
- package/model/pickVSAdvertisementCreditUpdateParamsExcludeKeyofVSAdvertisementCreditUpdateParamsId.ts +58 -58
- package/model/pickVSCampaignUpdateParamsExcludeKeyofVSCampaignUpdateParamsStartDateOrExpirationDate.ts +106 -106
- package/model/pickVSDynamicVoucherExcludeKeyofVSDynamicVoucherTemporalDecreaseFrequencyType.ts +142 -142
- package/model/pickVSPaymentDesignCreateParamsExcludeKeyofVSPaymentDesignCreateParamsBackgroundImageURLOrCompanyLogoURLOrEmployeeID.ts +94 -94
- package/model/pickVSPaymentDesignUpdateParamsExcludeKeyofVSPaymentDesignUpdateParamsId.ts +106 -106
- package/model/pickVSStaticVoucherExcludeKeyofVSStaticVoucherRedeemedAtOrRefundedAtOrLastViewedAt.ts +167 -167
- package/model/pickWTAdvertisementCreditCreateParamsExcludeKeyofWTAdvertisementCreditCreateParamsEmployeeID.ts +58 -58
- package/model/pickWTEmployeeCreateExcludeKeyofWTEmployeeCreateEmail.ts +58 -58
- package/model/pickWTMemberMemberIDOrFirstNameOrLastNameOrMembershipTierIDOrPointsAccruedOrMobileNumber.ts +76 -76
- package/model/pickWTMerchantCreditMemberIDOrCreditAmountOrMobileNumber.ts +52 -52
- package/model/pickWTMerchantURLUpdateExcludeKeyofWTMerchantURLUpdateUrlID.ts +40 -40
- package/model/pickWTNewsArticleUpdateParamsExcludeKeyofWTNewsArticleUpdateParamsId.ts +58 -58
- package/model/pickWTPaymentObjectBroadcastExcludeKeyofWTPaymentObjectBroadcastListTypeOrListID.ts +138 -138
- package/model/pickWTStaticVoucherCampaignCreateParamsExcludeKeyofWTStaticVoucherCampaignCreateParamsStartDateTimeOrExpirationDateTime.ts +112 -112
- package/model/pickWTStaticVoucherCreateParamsExcludeKeyofWTStaticVoucherCreateParamsCampaignID.ts +46 -46
- package/model/plan.ts +62 -62
- package/model/portalPage.ts +67 -67
- package/model/presignedPost.ts +41 -41
- package/model/presignedPostFields.ts +43 -43
- package/model/product.ts +74 -74
- package/model/promoCode.ts +97 -97
- package/model/reachPerformanceStats.ts +70 -70
- package/model/request.ts +349 -349
- package/model/response.ts +67 -67
- package/model/role.ts +117 -117
- package/model/roleAuditLog.ts +97 -97
- package/model/sSOptInSource.ts +73 -73
- package/model/simpleSMSBroadcast.ts +147 -147
- package/model/staticVoucher.ts +224 -224
- package/model/staticVoucherCampaign.ts +175 -175
- package/model/staticVoucherCampaignBroadcast.ts +142 -142
- package/model/staticVoucherCampaignGroup.ts +85 -85
- package/model/staticVoucherCampaignUpdate.ts +85 -85
- package/model/status.ts +30 -30
- package/model/statusAnyOf.ts +17 -17
- package/model/statusAnyOf1.ts +17 -17
- package/model/statusAnyOf2.ts +17 -17
- package/model/statusAnyOf3.ts +17 -17
- package/model/subscriptionFeature.ts +79 -79
- package/model/subscriptionPlan.ts +69 -69
- package/model/subscriptionProduct.ts +81 -81
- package/model/tcpa.ts +67 -67
- package/model/updateStaticVoucherCampaignWithVoucher.ts +109 -109
- package/model/vSCampaignGeneratedMessage.ts +43 -43
- package/model/vSCampaignGeneratedMessagePagination.ts +53 -53
- package/model/vSDynamicVoucherStatus.ts +28 -28
- package/model/wTAdvertisementCredit.ts +103 -103
- package/model/wTAdvertisementCreditScan.ts +170 -170
- package/model/wTAdvertisementCreditUpdateParams.ts +55 -55
- package/model/wTDynamicVoucher.ts +224 -224
- package/model/wTDynamicVoucherCreateParams.ts +103 -103
- package/model/wTDynamicVoucherRedemption.ts +164 -164
- package/model/wTDynamicVoucherSummary.ts +169 -169
- package/model/wTDynamicVoucherUpdateParams.ts +103 -103
- package/model/wTEmployee.ts +109 -109
- package/model/wTEmployeeCreate.ts +61 -61
- package/model/wTEmployeeUpdate.ts +55 -55
- package/model/wTImportedList.ts +73 -73
- package/model/wTLinkBookCreateParams.ts +55 -55
- package/model/wTLinkBookSectionCreateParams.ts +31 -31
- package/model/wTLinkBookSectionUpdateParams.ts +31 -31
- package/model/wTLinkBookUpdateParams.ts +55 -55
- package/model/wTMember.ts +118 -118
- package/model/wTMemberCreationParams.ts +73 -73
- package/model/wTMembershipTier.ts +106 -106
- package/model/wTMembershipTierCreationParams.ts +64 -64
- package/model/wTMembershipTierUpdateParams.ts +64 -64
- package/model/wTMembershipTierWithMemberCount.ts +115 -115
- package/model/wTMerchantCredit.ts +106 -106
- package/model/wTMerchantCreditCreationParams.ts +49 -49
- package/model/wTMerchantURLCreate.ts +37 -37
- package/model/wTMerchantURLUpdate.ts +37 -37
- package/model/wTNewsArticleCreateParams.ts +55 -55
- package/model/wTNewsArticleUpdateParams.ts +55 -55
- package/model/wTOptInList.ts +121 -121
- package/model/wTOptInListCreationParams.ts +91 -91
- package/model/wTPaymentDesign.ts +139 -139
- package/model/wTPaymentDesignCreateParams.ts +115 -115
- package/model/wTPaymentDesignUpdateParams.ts +115 -115
- package/model/wTPerformanceCreateParams.ts +70 -70
- package/model/wTPerformanceUpdateParams.ts +70 -70
- package/model/wTPosMachine.ts +88 -88
- package/model/wTPosMachineCreateParams.ts +58 -58
- package/model/wTPosMachineUpdateParams.ts +58 -58
- package/model/wTPromoCodeCreateParams.ts +67 -67
- package/model/wTPromoCodeUpdateParams.ts +67 -67
- package/model/wTRole.ts +116 -116
- package/model/wTStaticVoucher.ts +224 -224
- package/model/wTStaticVoucherCampaign.ts +175 -175
- package/model/wTStaticVoucherCreateParams.ts +49 -49
- package/model/wTStaticVoucherUpdateParams.ts +43 -43
- package/model/wTWalletPageView.ts +251 -251
- package/model/wTWalletPageViewGeoPoint.ts +37 -37
- package/model/walletPageView.ts +251 -251
- package/model/webpage.ts +85 -85
- package/package.json +28 -25
- package/readme-generator.py +42 -42
- package/tsconfig.json +25 -25
|
@@ -1,603 +1,603 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* wallet-api
|
|
3
|
-
* API
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 1.1.3
|
|
6
|
-
* Contact: development@wallet.inc
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
-
* https://openapi-generator.tech
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import localVarRequest from 'request';
|
|
15
|
-
import http from 'http';
|
|
16
|
-
|
|
17
|
-
/* tslint:disable:no-unused-locals */
|
|
18
|
-
import { AuthError } from '../model/authError';
|
|
19
|
-
import { DuplicateRowFound } from '../model/duplicateRowFound';
|
|
20
|
-
import { FalsumError } from '../model/falsumError';
|
|
21
|
-
import { ForeignKeyDoesNotExist } from '../model/foreignKeyDoesNotExist';
|
|
22
|
-
import { InternalServerError } from '../model/internalServerError';
|
|
23
|
-
import { MerchantNotInitialized } from '../model/merchantNotInitialized';
|
|
24
|
-
import { ReachPerformanceStats } from '../model/reachPerformanceStats';
|
|
25
|
-
import { WTDynamicVoucher } from '../model/wTDynamicVoucher';
|
|
26
|
-
import { WTDynamicVoucherCreateParams } from '../model/wTDynamicVoucherCreateParams';
|
|
27
|
-
import { WTDynamicVoucherRedemption } from '../model/wTDynamicVoucherRedemption';
|
|
28
|
-
import { WTDynamicVoucherUpdateParams } from '../model/wTDynamicVoucherUpdateParams';
|
|
29
|
-
|
|
30
|
-
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
31
|
-
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
32
|
-
|
|
33
|
-
import { HttpError, RequestFile } from './apis';
|
|
34
|
-
|
|
35
|
-
let defaultBasePath = 'https://api.wall.et';
|
|
36
|
-
|
|
37
|
-
// ===============================================
|
|
38
|
-
// This file is autogenerated - Please do not edit
|
|
39
|
-
// ===============================================
|
|
40
|
-
|
|
41
|
-
export enum DynamicVouchersApiApiKeys {
|
|
42
|
-
api_key,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export class DynamicVouchersApi {
|
|
46
|
-
protected _basePath = defaultBasePath;
|
|
47
|
-
protected _defaultHeaders : any = {};
|
|
48
|
-
protected _useQuerystring : boolean = false;
|
|
49
|
-
|
|
50
|
-
protected authentications = {
|
|
51
|
-
'default': <Authentication>new VoidAuth(),
|
|
52
|
-
'api_key': new ApiKeyAuth('header', 'access-token'),
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
protected interceptors: Interceptor[] = [];
|
|
56
|
-
|
|
57
|
-
constructor(basePath?: string);
|
|
58
|
-
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
59
|
-
if (password) {
|
|
60
|
-
if (basePath) {
|
|
61
|
-
this.basePath = basePath;
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
if (basePathOrUsername) {
|
|
65
|
-
this.basePath = basePathOrUsername
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
set useQuerystring(value: boolean) {
|
|
71
|
-
this._useQuerystring = value;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
set basePath(basePath: string) {
|
|
75
|
-
this._basePath = basePath;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
set defaultHeaders(defaultHeaders: any) {
|
|
79
|
-
this._defaultHeaders = defaultHeaders;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
get defaultHeaders() {
|
|
83
|
-
return this._defaultHeaders;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
get basePath() {
|
|
87
|
-
return this._basePath;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
public setDefaultAuthentication(auth: Authentication) {
|
|
91
|
-
this.authentications.default = auth;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
public setApiKey(key: DynamicVouchersApiApiKeys, value: string) {
|
|
95
|
-
(this.authentications as any)[DynamicVouchersApiApiKeys[key]].apiKey = value;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
public addInterceptor(interceptor: Interceptor) {
|
|
99
|
-
this.interceptors.push(interceptor);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
*
|
|
104
|
-
* @summary Create dynamic voucher
|
|
105
|
-
* @param wTDynamicVoucherCreateParams
|
|
106
|
-
*/
|
|
107
|
-
public async createDynamicVoucher (wTDynamicVoucherCreateParams: WTDynamicVoucherCreateParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }> {
|
|
108
|
-
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher';
|
|
109
|
-
let localVarQueryParameters: any = {};
|
|
110
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
111
|
-
const produces = ['application/json'];
|
|
112
|
-
// give precedence to 'application/json'
|
|
113
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
114
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
115
|
-
} else {
|
|
116
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
117
|
-
}
|
|
118
|
-
let localVarFormParams: any = {};
|
|
119
|
-
|
|
120
|
-
// verify required parameter 'wTDynamicVoucherCreateParams' is not null or undefined
|
|
121
|
-
if (wTDynamicVoucherCreateParams === null || wTDynamicVoucherCreateParams === undefined) {
|
|
122
|
-
throw new Error('Required parameter wTDynamicVoucherCreateParams was null or undefined when calling createDynamicVoucher.');
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
126
|
-
|
|
127
|
-
let localVarUseFormData = false;
|
|
128
|
-
|
|
129
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
130
|
-
method: 'POST',
|
|
131
|
-
qs: localVarQueryParameters,
|
|
132
|
-
headers: localVarHeaderParams,
|
|
133
|
-
uri: localVarPath,
|
|
134
|
-
useQuerystring: this._useQuerystring,
|
|
135
|
-
json: true,
|
|
136
|
-
body: ObjectSerializer.serialize(wTDynamicVoucherCreateParams, "WTDynamicVoucherCreateParams")
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
let authenticationPromise = Promise.resolve();
|
|
140
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
141
|
-
|
|
142
|
-
let interceptorPromise = authenticationPromise;
|
|
143
|
-
for (const interceptor of this.interceptors) {
|
|
144
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return interceptorPromise.then(() => {
|
|
148
|
-
if (Object.keys(localVarFormParams).length) {
|
|
149
|
-
if (localVarUseFormData) {
|
|
150
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
151
|
-
} else {
|
|
152
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return new Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }>((resolve, reject) => {
|
|
156
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
157
|
-
if (error) {
|
|
158
|
-
reject(error);
|
|
159
|
-
} else {
|
|
160
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
161
|
-
body = ObjectSerializer.deserialize(body, "WTDynamicVoucher");
|
|
162
|
-
resolve({ response: response, body: body });
|
|
163
|
-
} else {
|
|
164
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
*
|
|
173
|
-
* @summary Fetch all active dynamic vouchers
|
|
174
|
-
* @param isArchiveIncluded
|
|
175
|
-
*/
|
|
176
|
-
public async fetchAllDynamicVouchers (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTDynamicVoucher>; }> {
|
|
177
|
-
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/all';
|
|
178
|
-
let localVarQueryParameters: any = {};
|
|
179
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
180
|
-
const produces = ['application/json'];
|
|
181
|
-
// give precedence to 'application/json'
|
|
182
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
183
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
184
|
-
} else {
|
|
185
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
186
|
-
}
|
|
187
|
-
let localVarFormParams: any = {};
|
|
188
|
-
|
|
189
|
-
if (isArchiveIncluded !== undefined) {
|
|
190
|
-
localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
194
|
-
|
|
195
|
-
let localVarUseFormData = false;
|
|
196
|
-
|
|
197
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
198
|
-
method: 'GET',
|
|
199
|
-
qs: localVarQueryParameters,
|
|
200
|
-
headers: localVarHeaderParams,
|
|
201
|
-
uri: localVarPath,
|
|
202
|
-
useQuerystring: this._useQuerystring,
|
|
203
|
-
json: true,
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
let authenticationPromise = Promise.resolve();
|
|
207
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
208
|
-
|
|
209
|
-
let interceptorPromise = authenticationPromise;
|
|
210
|
-
for (const interceptor of this.interceptors) {
|
|
211
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
return interceptorPromise.then(() => {
|
|
215
|
-
if (Object.keys(localVarFormParams).length) {
|
|
216
|
-
if (localVarUseFormData) {
|
|
217
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
218
|
-
} else {
|
|
219
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return new Promise<{ response: http.IncomingMessage; body: Array<WTDynamicVoucher>; }>((resolve, reject) => {
|
|
223
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
224
|
-
if (error) {
|
|
225
|
-
reject(error);
|
|
226
|
-
} else {
|
|
227
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
228
|
-
body = ObjectSerializer.deserialize(body, "Array<WTDynamicVoucher>");
|
|
229
|
-
resolve({ response: response, body: body });
|
|
230
|
-
} else {
|
|
231
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
*
|
|
240
|
-
* @summary Fetch dynamic voucher
|
|
241
|
-
* @param id
|
|
242
|
-
*/
|
|
243
|
-
public async fetchDynamicVoucherById (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }> {
|
|
244
|
-
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/{id}'
|
|
245
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
246
|
-
let localVarQueryParameters: any = {};
|
|
247
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
248
|
-
const produces = ['application/json'];
|
|
249
|
-
// give precedence to 'application/json'
|
|
250
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
251
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
252
|
-
} else {
|
|
253
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
254
|
-
}
|
|
255
|
-
let localVarFormParams: any = {};
|
|
256
|
-
|
|
257
|
-
// verify required parameter 'id' is not null or undefined
|
|
258
|
-
if (id === null || id === undefined) {
|
|
259
|
-
throw new Error('Required parameter id was null or undefined when calling fetchDynamicVoucherById.');
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
263
|
-
|
|
264
|
-
let localVarUseFormData = false;
|
|
265
|
-
|
|
266
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
267
|
-
method: 'GET',
|
|
268
|
-
qs: localVarQueryParameters,
|
|
269
|
-
headers: localVarHeaderParams,
|
|
270
|
-
uri: localVarPath,
|
|
271
|
-
useQuerystring: this._useQuerystring,
|
|
272
|
-
json: true,
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
let authenticationPromise = Promise.resolve();
|
|
276
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
277
|
-
|
|
278
|
-
let interceptorPromise = authenticationPromise;
|
|
279
|
-
for (const interceptor of this.interceptors) {
|
|
280
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
return interceptorPromise.then(() => {
|
|
284
|
-
if (Object.keys(localVarFormParams).length) {
|
|
285
|
-
if (localVarUseFormData) {
|
|
286
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
287
|
-
} else {
|
|
288
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
return new Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }>((resolve, reject) => {
|
|
292
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
293
|
-
if (error) {
|
|
294
|
-
reject(error);
|
|
295
|
-
} else {
|
|
296
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
297
|
-
body = ObjectSerializer.deserialize(body, "WTDynamicVoucher");
|
|
298
|
-
resolve({ response: response, body: body });
|
|
299
|
-
} else {
|
|
300
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
*
|
|
309
|
-
* @summary Fetch redemptions
|
|
310
|
-
* @param id
|
|
311
|
-
*/
|
|
312
|
-
public async fetchDynamicVoucherRedemptions (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTDynamicVoucherRedemption>; }> {
|
|
313
|
-
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/redemptions/{id}'
|
|
314
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
315
|
-
let localVarQueryParameters: any = {};
|
|
316
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
317
|
-
const produces = ['application/json'];
|
|
318
|
-
// give precedence to 'application/json'
|
|
319
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
320
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
321
|
-
} else {
|
|
322
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
323
|
-
}
|
|
324
|
-
let localVarFormParams: any = {};
|
|
325
|
-
|
|
326
|
-
// verify required parameter 'id' is not null or undefined
|
|
327
|
-
if (id === null || id === undefined) {
|
|
328
|
-
throw new Error('Required parameter id was null or undefined when calling fetchDynamicVoucherRedemptions.');
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
332
|
-
|
|
333
|
-
let localVarUseFormData = false;
|
|
334
|
-
|
|
335
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
336
|
-
method: 'GET',
|
|
337
|
-
qs: localVarQueryParameters,
|
|
338
|
-
headers: localVarHeaderParams,
|
|
339
|
-
uri: localVarPath,
|
|
340
|
-
useQuerystring: this._useQuerystring,
|
|
341
|
-
json: true,
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
let authenticationPromise = Promise.resolve();
|
|
345
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
346
|
-
|
|
347
|
-
let interceptorPromise = authenticationPromise;
|
|
348
|
-
for (const interceptor of this.interceptors) {
|
|
349
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
return interceptorPromise.then(() => {
|
|
353
|
-
if (Object.keys(localVarFormParams).length) {
|
|
354
|
-
if (localVarUseFormData) {
|
|
355
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
356
|
-
} else {
|
|
357
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
return new Promise<{ response: http.IncomingMessage; body: Array<WTDynamicVoucherRedemption>; }>((resolve, reject) => {
|
|
361
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
362
|
-
if (error) {
|
|
363
|
-
reject(error);
|
|
364
|
-
} else {
|
|
365
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
366
|
-
body = ObjectSerializer.deserialize(body, "Array<WTDynamicVoucherRedemption>");
|
|
367
|
-
resolve({ response: response, body: body });
|
|
368
|
-
} else {
|
|
369
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
});
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
*
|
|
378
|
-
* @summary Get the reach statistics of all the dynamic vouchers
|
|
379
|
-
* @param broadcastScheduledStartAt
|
|
380
|
-
* @param broadcastScheduledEndAt
|
|
381
|
-
*/
|
|
382
|
-
public async fetchReachStatsOfAllDynamicVouchers (broadcastScheduledStartAt?: Date, broadcastScheduledEndAt?: Date, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }> {
|
|
383
|
-
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/reach/all';
|
|
384
|
-
let localVarQueryParameters: any = {};
|
|
385
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
386
|
-
const produces = ['application/json'];
|
|
387
|
-
// give precedence to 'application/json'
|
|
388
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
389
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
390
|
-
} else {
|
|
391
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
392
|
-
}
|
|
393
|
-
let localVarFormParams: any = {};
|
|
394
|
-
|
|
395
|
-
if (broadcastScheduledStartAt !== undefined) {
|
|
396
|
-
localVarQueryParameters['broadcastScheduledStartAt'] = ObjectSerializer.serialize(broadcastScheduledStartAt, "Date");
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
if (broadcastScheduledEndAt !== undefined) {
|
|
400
|
-
localVarQueryParameters['broadcastScheduledEndAt'] = ObjectSerializer.serialize(broadcastScheduledEndAt, "Date");
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
404
|
-
|
|
405
|
-
let localVarUseFormData = false;
|
|
406
|
-
|
|
407
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
408
|
-
method: 'GET',
|
|
409
|
-
qs: localVarQueryParameters,
|
|
410
|
-
headers: localVarHeaderParams,
|
|
411
|
-
uri: localVarPath,
|
|
412
|
-
useQuerystring: this._useQuerystring,
|
|
413
|
-
json: true,
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
let authenticationPromise = Promise.resolve();
|
|
417
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
418
|
-
|
|
419
|
-
let interceptorPromise = authenticationPromise;
|
|
420
|
-
for (const interceptor of this.interceptors) {
|
|
421
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
return interceptorPromise.then(() => {
|
|
425
|
-
if (Object.keys(localVarFormParams).length) {
|
|
426
|
-
if (localVarUseFormData) {
|
|
427
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
428
|
-
} else {
|
|
429
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
return new Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }>((resolve, reject) => {
|
|
433
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
434
|
-
if (error) {
|
|
435
|
-
reject(error);
|
|
436
|
-
} else {
|
|
437
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
438
|
-
body = ObjectSerializer.deserialize(body, "ReachPerformanceStats");
|
|
439
|
-
resolve({ response: response, body: body });
|
|
440
|
-
} else {
|
|
441
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
});
|
|
445
|
-
});
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
*
|
|
450
|
-
* @summary Get the reach statistics of an individual dynamic voucher
|
|
451
|
-
* @param dynamicVoucherID
|
|
452
|
-
* @param broadcastScheduledStartAt
|
|
453
|
-
* @param broadcastScheduledEndAt
|
|
454
|
-
*/
|
|
455
|
-
public async fetchReachStatsOfIndividualDynamicVoucher (dynamicVoucherID: any, broadcastScheduledStartAt?: Date, broadcastScheduledEndAt?: Date, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }> {
|
|
456
|
-
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/reach/{dynamicVoucherID}'
|
|
457
|
-
.replace('{' + 'dynamicVoucherID' + '}', encodeURIComponent(String(dynamicVoucherID)));
|
|
458
|
-
let localVarQueryParameters: any = {};
|
|
459
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
460
|
-
const produces = ['application/json'];
|
|
461
|
-
// give precedence to 'application/json'
|
|
462
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
463
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
464
|
-
} else {
|
|
465
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
466
|
-
}
|
|
467
|
-
let localVarFormParams: any = {};
|
|
468
|
-
|
|
469
|
-
// verify required parameter 'dynamicVoucherID' is not null or undefined
|
|
470
|
-
if (dynamicVoucherID === null || dynamicVoucherID === undefined) {
|
|
471
|
-
throw new Error('Required parameter dynamicVoucherID was null or undefined when calling fetchReachStatsOfIndividualDynamicVoucher.');
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
if (broadcastScheduledStartAt !== undefined) {
|
|
475
|
-
localVarQueryParameters['broadcastScheduledStartAt'] = ObjectSerializer.serialize(broadcastScheduledStartAt, "Date");
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
if (broadcastScheduledEndAt !== undefined) {
|
|
479
|
-
localVarQueryParameters['broadcastScheduledEndAt'] = ObjectSerializer.serialize(broadcastScheduledEndAt, "Date");
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
483
|
-
|
|
484
|
-
let localVarUseFormData = false;
|
|
485
|
-
|
|
486
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
487
|
-
method: 'GET',
|
|
488
|
-
qs: localVarQueryParameters,
|
|
489
|
-
headers: localVarHeaderParams,
|
|
490
|
-
uri: localVarPath,
|
|
491
|
-
useQuerystring: this._useQuerystring,
|
|
492
|
-
json: true,
|
|
493
|
-
};
|
|
494
|
-
|
|
495
|
-
let authenticationPromise = Promise.resolve();
|
|
496
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
497
|
-
|
|
498
|
-
let interceptorPromise = authenticationPromise;
|
|
499
|
-
for (const interceptor of this.interceptors) {
|
|
500
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
return interceptorPromise.then(() => {
|
|
504
|
-
if (Object.keys(localVarFormParams).length) {
|
|
505
|
-
if (localVarUseFormData) {
|
|
506
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
507
|
-
} else {
|
|
508
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
return new Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }>((resolve, reject) => {
|
|
512
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
513
|
-
if (error) {
|
|
514
|
-
reject(error);
|
|
515
|
-
} else {
|
|
516
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
517
|
-
body = ObjectSerializer.deserialize(body, "ReachPerformanceStats");
|
|
518
|
-
resolve({ response: response, body: body });
|
|
519
|
-
} else {
|
|
520
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
|
-
});
|
|
525
|
-
});
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
*
|
|
529
|
-
* @summary Update dynamic voucher
|
|
530
|
-
* @param id
|
|
531
|
-
* @param wTDynamicVoucherUpdateParams
|
|
532
|
-
*/
|
|
533
|
-
public async saveDynamicVoucher (id: any, wTDynamicVoucherUpdateParams: WTDynamicVoucherUpdateParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }> {
|
|
534
|
-
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/{id}'
|
|
535
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
536
|
-
let localVarQueryParameters: any = {};
|
|
537
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
538
|
-
const produces = ['application/json'];
|
|
539
|
-
// give precedence to 'application/json'
|
|
540
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
541
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
542
|
-
} else {
|
|
543
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
544
|
-
}
|
|
545
|
-
let localVarFormParams: any = {};
|
|
546
|
-
|
|
547
|
-
// verify required parameter 'id' is not null or undefined
|
|
548
|
-
if (id === null || id === undefined) {
|
|
549
|
-
throw new Error('Required parameter id was null or undefined when calling saveDynamicVoucher.');
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
// verify required parameter 'wTDynamicVoucherUpdateParams' is not null or undefined
|
|
553
|
-
if (wTDynamicVoucherUpdateParams === null || wTDynamicVoucherUpdateParams === undefined) {
|
|
554
|
-
throw new Error('Required parameter wTDynamicVoucherUpdateParams was null or undefined when calling saveDynamicVoucher.');
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
558
|
-
|
|
559
|
-
let localVarUseFormData = false;
|
|
560
|
-
|
|
561
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
562
|
-
method: 'PUT',
|
|
563
|
-
qs: localVarQueryParameters,
|
|
564
|
-
headers: localVarHeaderParams,
|
|
565
|
-
uri: localVarPath,
|
|
566
|
-
useQuerystring: this._useQuerystring,
|
|
567
|
-
json: true,
|
|
568
|
-
body: ObjectSerializer.serialize(wTDynamicVoucherUpdateParams, "WTDynamicVoucherUpdateParams")
|
|
569
|
-
};
|
|
570
|
-
|
|
571
|
-
let authenticationPromise = Promise.resolve();
|
|
572
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
573
|
-
|
|
574
|
-
let interceptorPromise = authenticationPromise;
|
|
575
|
-
for (const interceptor of this.interceptors) {
|
|
576
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
return interceptorPromise.then(() => {
|
|
580
|
-
if (Object.keys(localVarFormParams).length) {
|
|
581
|
-
if (localVarUseFormData) {
|
|
582
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
583
|
-
} else {
|
|
584
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
return new Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }>((resolve, reject) => {
|
|
588
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
589
|
-
if (error) {
|
|
590
|
-
reject(error);
|
|
591
|
-
} else {
|
|
592
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
593
|
-
body = ObjectSerializer.deserialize(body, "WTDynamicVoucher");
|
|
594
|
-
resolve({ response: response, body: body });
|
|
595
|
-
} else {
|
|
596
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
});
|
|
600
|
-
});
|
|
601
|
-
});
|
|
602
|
-
}
|
|
603
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* wallet-api
|
|
3
|
+
* API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.1.3
|
|
6
|
+
* Contact: development@wallet.inc
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import localVarRequest from 'request';
|
|
15
|
+
import http from 'http';
|
|
16
|
+
|
|
17
|
+
/* tslint:disable:no-unused-locals */
|
|
18
|
+
import { AuthError } from '../model/authError';
|
|
19
|
+
import { DuplicateRowFound } from '../model/duplicateRowFound';
|
|
20
|
+
import { FalsumError } from '../model/falsumError';
|
|
21
|
+
import { ForeignKeyDoesNotExist } from '../model/foreignKeyDoesNotExist';
|
|
22
|
+
import { InternalServerError } from '../model/internalServerError';
|
|
23
|
+
import { MerchantNotInitialized } from '../model/merchantNotInitialized';
|
|
24
|
+
import { ReachPerformanceStats } from '../model/reachPerformanceStats';
|
|
25
|
+
import { WTDynamicVoucher } from '../model/wTDynamicVoucher';
|
|
26
|
+
import { WTDynamicVoucherCreateParams } from '../model/wTDynamicVoucherCreateParams';
|
|
27
|
+
import { WTDynamicVoucherRedemption } from '../model/wTDynamicVoucherRedemption';
|
|
28
|
+
import { WTDynamicVoucherUpdateParams } from '../model/wTDynamicVoucherUpdateParams';
|
|
29
|
+
|
|
30
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
31
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
32
|
+
|
|
33
|
+
import { HttpError, RequestFile } from './apis';
|
|
34
|
+
|
|
35
|
+
let defaultBasePath = 'https://api.wall.et';
|
|
36
|
+
|
|
37
|
+
// ===============================================
|
|
38
|
+
// This file is autogenerated - Please do not edit
|
|
39
|
+
// ===============================================
|
|
40
|
+
|
|
41
|
+
export enum DynamicVouchersApiApiKeys {
|
|
42
|
+
api_key,
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export class DynamicVouchersApi {
|
|
46
|
+
protected _basePath = defaultBasePath;
|
|
47
|
+
protected _defaultHeaders : any = {};
|
|
48
|
+
protected _useQuerystring : boolean = false;
|
|
49
|
+
|
|
50
|
+
protected authentications = {
|
|
51
|
+
'default': <Authentication>new VoidAuth(),
|
|
52
|
+
'api_key': new ApiKeyAuth('header', 'access-token'),
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
protected interceptors: Interceptor[] = [];
|
|
56
|
+
|
|
57
|
+
constructor(basePath?: string);
|
|
58
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
59
|
+
if (password) {
|
|
60
|
+
if (basePath) {
|
|
61
|
+
this.basePath = basePath;
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
if (basePathOrUsername) {
|
|
65
|
+
this.basePath = basePathOrUsername
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
set useQuerystring(value: boolean) {
|
|
71
|
+
this._useQuerystring = value;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
set basePath(basePath: string) {
|
|
75
|
+
this._basePath = basePath;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
79
|
+
this._defaultHeaders = defaultHeaders;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
get defaultHeaders() {
|
|
83
|
+
return this._defaultHeaders;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
get basePath() {
|
|
87
|
+
return this._basePath;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
91
|
+
this.authentications.default = auth;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public setApiKey(key: DynamicVouchersApiApiKeys, value: string) {
|
|
95
|
+
(this.authentications as any)[DynamicVouchersApiApiKeys[key]].apiKey = value;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
99
|
+
this.interceptors.push(interceptor);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
* @summary Create dynamic voucher
|
|
105
|
+
* @param wTDynamicVoucherCreateParams
|
|
106
|
+
*/
|
|
107
|
+
public async createDynamicVoucher (wTDynamicVoucherCreateParams: WTDynamicVoucherCreateParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }> {
|
|
108
|
+
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher';
|
|
109
|
+
let localVarQueryParameters: any = {};
|
|
110
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
111
|
+
const produces = ['application/json'];
|
|
112
|
+
// give precedence to 'application/json'
|
|
113
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
114
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
115
|
+
} else {
|
|
116
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
117
|
+
}
|
|
118
|
+
let localVarFormParams: any = {};
|
|
119
|
+
|
|
120
|
+
// verify required parameter 'wTDynamicVoucherCreateParams' is not null or undefined
|
|
121
|
+
if (wTDynamicVoucherCreateParams === null || wTDynamicVoucherCreateParams === undefined) {
|
|
122
|
+
throw new Error('Required parameter wTDynamicVoucherCreateParams was null or undefined when calling createDynamicVoucher.');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
126
|
+
|
|
127
|
+
let localVarUseFormData = false;
|
|
128
|
+
|
|
129
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
130
|
+
method: 'POST',
|
|
131
|
+
qs: localVarQueryParameters,
|
|
132
|
+
headers: localVarHeaderParams,
|
|
133
|
+
uri: localVarPath,
|
|
134
|
+
useQuerystring: this._useQuerystring,
|
|
135
|
+
json: true,
|
|
136
|
+
body: ObjectSerializer.serialize(wTDynamicVoucherCreateParams, "WTDynamicVoucherCreateParams")
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
let authenticationPromise = Promise.resolve();
|
|
140
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
141
|
+
|
|
142
|
+
let interceptorPromise = authenticationPromise;
|
|
143
|
+
for (const interceptor of this.interceptors) {
|
|
144
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return interceptorPromise.then(() => {
|
|
148
|
+
if (Object.keys(localVarFormParams).length) {
|
|
149
|
+
if (localVarUseFormData) {
|
|
150
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
151
|
+
} else {
|
|
152
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return new Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }>((resolve, reject) => {
|
|
156
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
157
|
+
if (error) {
|
|
158
|
+
reject(error);
|
|
159
|
+
} else {
|
|
160
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
161
|
+
body = ObjectSerializer.deserialize(body, "WTDynamicVoucher");
|
|
162
|
+
resolve({ response: response, body: body });
|
|
163
|
+
} else {
|
|
164
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
*
|
|
173
|
+
* @summary Fetch all active dynamic vouchers
|
|
174
|
+
* @param isArchiveIncluded
|
|
175
|
+
*/
|
|
176
|
+
public async fetchAllDynamicVouchers (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTDynamicVoucher>; }> {
|
|
177
|
+
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/all';
|
|
178
|
+
let localVarQueryParameters: any = {};
|
|
179
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
180
|
+
const produces = ['application/json'];
|
|
181
|
+
// give precedence to 'application/json'
|
|
182
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
183
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
184
|
+
} else {
|
|
185
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
186
|
+
}
|
|
187
|
+
let localVarFormParams: any = {};
|
|
188
|
+
|
|
189
|
+
if (isArchiveIncluded !== undefined) {
|
|
190
|
+
localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
194
|
+
|
|
195
|
+
let localVarUseFormData = false;
|
|
196
|
+
|
|
197
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
198
|
+
method: 'GET',
|
|
199
|
+
qs: localVarQueryParameters,
|
|
200
|
+
headers: localVarHeaderParams,
|
|
201
|
+
uri: localVarPath,
|
|
202
|
+
useQuerystring: this._useQuerystring,
|
|
203
|
+
json: true,
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
let authenticationPromise = Promise.resolve();
|
|
207
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
208
|
+
|
|
209
|
+
let interceptorPromise = authenticationPromise;
|
|
210
|
+
for (const interceptor of this.interceptors) {
|
|
211
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return interceptorPromise.then(() => {
|
|
215
|
+
if (Object.keys(localVarFormParams).length) {
|
|
216
|
+
if (localVarUseFormData) {
|
|
217
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
218
|
+
} else {
|
|
219
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<WTDynamicVoucher>; }>((resolve, reject) => {
|
|
223
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
224
|
+
if (error) {
|
|
225
|
+
reject(error);
|
|
226
|
+
} else {
|
|
227
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
228
|
+
body = ObjectSerializer.deserialize(body, "Array<WTDynamicVoucher>");
|
|
229
|
+
resolve({ response: response, body: body });
|
|
230
|
+
} else {
|
|
231
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
*
|
|
240
|
+
* @summary Fetch dynamic voucher
|
|
241
|
+
* @param id
|
|
242
|
+
*/
|
|
243
|
+
public async fetchDynamicVoucherById (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }> {
|
|
244
|
+
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/{id}'
|
|
245
|
+
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
246
|
+
let localVarQueryParameters: any = {};
|
|
247
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
248
|
+
const produces = ['application/json'];
|
|
249
|
+
// give precedence to 'application/json'
|
|
250
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
251
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
252
|
+
} else {
|
|
253
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
254
|
+
}
|
|
255
|
+
let localVarFormParams: any = {};
|
|
256
|
+
|
|
257
|
+
// verify required parameter 'id' is not null or undefined
|
|
258
|
+
if (id === null || id === undefined) {
|
|
259
|
+
throw new Error('Required parameter id was null or undefined when calling fetchDynamicVoucherById.');
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
263
|
+
|
|
264
|
+
let localVarUseFormData = false;
|
|
265
|
+
|
|
266
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
267
|
+
method: 'GET',
|
|
268
|
+
qs: localVarQueryParameters,
|
|
269
|
+
headers: localVarHeaderParams,
|
|
270
|
+
uri: localVarPath,
|
|
271
|
+
useQuerystring: this._useQuerystring,
|
|
272
|
+
json: true,
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
let authenticationPromise = Promise.resolve();
|
|
276
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
277
|
+
|
|
278
|
+
let interceptorPromise = authenticationPromise;
|
|
279
|
+
for (const interceptor of this.interceptors) {
|
|
280
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return interceptorPromise.then(() => {
|
|
284
|
+
if (Object.keys(localVarFormParams).length) {
|
|
285
|
+
if (localVarUseFormData) {
|
|
286
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
287
|
+
} else {
|
|
288
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return new Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }>((resolve, reject) => {
|
|
292
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
293
|
+
if (error) {
|
|
294
|
+
reject(error);
|
|
295
|
+
} else {
|
|
296
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
297
|
+
body = ObjectSerializer.deserialize(body, "WTDynamicVoucher");
|
|
298
|
+
resolve({ response: response, body: body });
|
|
299
|
+
} else {
|
|
300
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
*
|
|
309
|
+
* @summary Fetch redemptions
|
|
310
|
+
* @param id
|
|
311
|
+
*/
|
|
312
|
+
public async fetchDynamicVoucherRedemptions (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTDynamicVoucherRedemption>; }> {
|
|
313
|
+
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/redemptions/{id}'
|
|
314
|
+
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
315
|
+
let localVarQueryParameters: any = {};
|
|
316
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
317
|
+
const produces = ['application/json'];
|
|
318
|
+
// give precedence to 'application/json'
|
|
319
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
320
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
321
|
+
} else {
|
|
322
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
323
|
+
}
|
|
324
|
+
let localVarFormParams: any = {};
|
|
325
|
+
|
|
326
|
+
// verify required parameter 'id' is not null or undefined
|
|
327
|
+
if (id === null || id === undefined) {
|
|
328
|
+
throw new Error('Required parameter id was null or undefined when calling fetchDynamicVoucherRedemptions.');
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
332
|
+
|
|
333
|
+
let localVarUseFormData = false;
|
|
334
|
+
|
|
335
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
336
|
+
method: 'GET',
|
|
337
|
+
qs: localVarQueryParameters,
|
|
338
|
+
headers: localVarHeaderParams,
|
|
339
|
+
uri: localVarPath,
|
|
340
|
+
useQuerystring: this._useQuerystring,
|
|
341
|
+
json: true,
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
let authenticationPromise = Promise.resolve();
|
|
345
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
346
|
+
|
|
347
|
+
let interceptorPromise = authenticationPromise;
|
|
348
|
+
for (const interceptor of this.interceptors) {
|
|
349
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
return interceptorPromise.then(() => {
|
|
353
|
+
if (Object.keys(localVarFormParams).length) {
|
|
354
|
+
if (localVarUseFormData) {
|
|
355
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
356
|
+
} else {
|
|
357
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<WTDynamicVoucherRedemption>; }>((resolve, reject) => {
|
|
361
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
362
|
+
if (error) {
|
|
363
|
+
reject(error);
|
|
364
|
+
} else {
|
|
365
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
366
|
+
body = ObjectSerializer.deserialize(body, "Array<WTDynamicVoucherRedemption>");
|
|
367
|
+
resolve({ response: response, body: body });
|
|
368
|
+
} else {
|
|
369
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
});
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
*
|
|
378
|
+
* @summary Get the reach statistics of all the dynamic vouchers
|
|
379
|
+
* @param broadcastScheduledStartAt
|
|
380
|
+
* @param broadcastScheduledEndAt
|
|
381
|
+
*/
|
|
382
|
+
public async fetchReachStatsOfAllDynamicVouchers (broadcastScheduledStartAt?: Date, broadcastScheduledEndAt?: Date, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }> {
|
|
383
|
+
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/reach/all';
|
|
384
|
+
let localVarQueryParameters: any = {};
|
|
385
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
386
|
+
const produces = ['application/json'];
|
|
387
|
+
// give precedence to 'application/json'
|
|
388
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
389
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
390
|
+
} else {
|
|
391
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
392
|
+
}
|
|
393
|
+
let localVarFormParams: any = {};
|
|
394
|
+
|
|
395
|
+
if (broadcastScheduledStartAt !== undefined) {
|
|
396
|
+
localVarQueryParameters['broadcastScheduledStartAt'] = ObjectSerializer.serialize(broadcastScheduledStartAt, "Date");
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
if (broadcastScheduledEndAt !== undefined) {
|
|
400
|
+
localVarQueryParameters['broadcastScheduledEndAt'] = ObjectSerializer.serialize(broadcastScheduledEndAt, "Date");
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
404
|
+
|
|
405
|
+
let localVarUseFormData = false;
|
|
406
|
+
|
|
407
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
408
|
+
method: 'GET',
|
|
409
|
+
qs: localVarQueryParameters,
|
|
410
|
+
headers: localVarHeaderParams,
|
|
411
|
+
uri: localVarPath,
|
|
412
|
+
useQuerystring: this._useQuerystring,
|
|
413
|
+
json: true,
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
let authenticationPromise = Promise.resolve();
|
|
417
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
418
|
+
|
|
419
|
+
let interceptorPromise = authenticationPromise;
|
|
420
|
+
for (const interceptor of this.interceptors) {
|
|
421
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
return interceptorPromise.then(() => {
|
|
425
|
+
if (Object.keys(localVarFormParams).length) {
|
|
426
|
+
if (localVarUseFormData) {
|
|
427
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
428
|
+
} else {
|
|
429
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
return new Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }>((resolve, reject) => {
|
|
433
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
434
|
+
if (error) {
|
|
435
|
+
reject(error);
|
|
436
|
+
} else {
|
|
437
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
438
|
+
body = ObjectSerializer.deserialize(body, "ReachPerformanceStats");
|
|
439
|
+
resolve({ response: response, body: body });
|
|
440
|
+
} else {
|
|
441
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
*
|
|
450
|
+
* @summary Get the reach statistics of an individual dynamic voucher
|
|
451
|
+
* @param dynamicVoucherID
|
|
452
|
+
* @param broadcastScheduledStartAt
|
|
453
|
+
* @param broadcastScheduledEndAt
|
|
454
|
+
*/
|
|
455
|
+
public async fetchReachStatsOfIndividualDynamicVoucher (dynamicVoucherID: any, broadcastScheduledStartAt?: Date, broadcastScheduledEndAt?: Date, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }> {
|
|
456
|
+
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/reach/{dynamicVoucherID}'
|
|
457
|
+
.replace('{' + 'dynamicVoucherID' + '}', encodeURIComponent(String(dynamicVoucherID)));
|
|
458
|
+
let localVarQueryParameters: any = {};
|
|
459
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
460
|
+
const produces = ['application/json'];
|
|
461
|
+
// give precedence to 'application/json'
|
|
462
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
463
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
464
|
+
} else {
|
|
465
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
466
|
+
}
|
|
467
|
+
let localVarFormParams: any = {};
|
|
468
|
+
|
|
469
|
+
// verify required parameter 'dynamicVoucherID' is not null or undefined
|
|
470
|
+
if (dynamicVoucherID === null || dynamicVoucherID === undefined) {
|
|
471
|
+
throw new Error('Required parameter dynamicVoucherID was null or undefined when calling fetchReachStatsOfIndividualDynamicVoucher.');
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
if (broadcastScheduledStartAt !== undefined) {
|
|
475
|
+
localVarQueryParameters['broadcastScheduledStartAt'] = ObjectSerializer.serialize(broadcastScheduledStartAt, "Date");
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
if (broadcastScheduledEndAt !== undefined) {
|
|
479
|
+
localVarQueryParameters['broadcastScheduledEndAt'] = ObjectSerializer.serialize(broadcastScheduledEndAt, "Date");
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
483
|
+
|
|
484
|
+
let localVarUseFormData = false;
|
|
485
|
+
|
|
486
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
487
|
+
method: 'GET',
|
|
488
|
+
qs: localVarQueryParameters,
|
|
489
|
+
headers: localVarHeaderParams,
|
|
490
|
+
uri: localVarPath,
|
|
491
|
+
useQuerystring: this._useQuerystring,
|
|
492
|
+
json: true,
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
let authenticationPromise = Promise.resolve();
|
|
496
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
497
|
+
|
|
498
|
+
let interceptorPromise = authenticationPromise;
|
|
499
|
+
for (const interceptor of this.interceptors) {
|
|
500
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
return interceptorPromise.then(() => {
|
|
504
|
+
if (Object.keys(localVarFormParams).length) {
|
|
505
|
+
if (localVarUseFormData) {
|
|
506
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
507
|
+
} else {
|
|
508
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
return new Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }>((resolve, reject) => {
|
|
512
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
513
|
+
if (error) {
|
|
514
|
+
reject(error);
|
|
515
|
+
} else {
|
|
516
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
517
|
+
body = ObjectSerializer.deserialize(body, "ReachPerformanceStats");
|
|
518
|
+
resolve({ response: response, body: body });
|
|
519
|
+
} else {
|
|
520
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
*
|
|
529
|
+
* @summary Update dynamic voucher
|
|
530
|
+
* @param id
|
|
531
|
+
* @param wTDynamicVoucherUpdateParams
|
|
532
|
+
*/
|
|
533
|
+
public async saveDynamicVoucher (id: any, wTDynamicVoucherUpdateParams: WTDynamicVoucherUpdateParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }> {
|
|
534
|
+
const localVarPath = this.basePath + '/v1/payment/dynamicVoucher/{id}'
|
|
535
|
+
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
536
|
+
let localVarQueryParameters: any = {};
|
|
537
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
538
|
+
const produces = ['application/json'];
|
|
539
|
+
// give precedence to 'application/json'
|
|
540
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
541
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
542
|
+
} else {
|
|
543
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
544
|
+
}
|
|
545
|
+
let localVarFormParams: any = {};
|
|
546
|
+
|
|
547
|
+
// verify required parameter 'id' is not null or undefined
|
|
548
|
+
if (id === null || id === undefined) {
|
|
549
|
+
throw new Error('Required parameter id was null or undefined when calling saveDynamicVoucher.');
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// verify required parameter 'wTDynamicVoucherUpdateParams' is not null or undefined
|
|
553
|
+
if (wTDynamicVoucherUpdateParams === null || wTDynamicVoucherUpdateParams === undefined) {
|
|
554
|
+
throw new Error('Required parameter wTDynamicVoucherUpdateParams was null or undefined when calling saveDynamicVoucher.');
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
558
|
+
|
|
559
|
+
let localVarUseFormData = false;
|
|
560
|
+
|
|
561
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
562
|
+
method: 'PUT',
|
|
563
|
+
qs: localVarQueryParameters,
|
|
564
|
+
headers: localVarHeaderParams,
|
|
565
|
+
uri: localVarPath,
|
|
566
|
+
useQuerystring: this._useQuerystring,
|
|
567
|
+
json: true,
|
|
568
|
+
body: ObjectSerializer.serialize(wTDynamicVoucherUpdateParams, "WTDynamicVoucherUpdateParams")
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
let authenticationPromise = Promise.resolve();
|
|
572
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
573
|
+
|
|
574
|
+
let interceptorPromise = authenticationPromise;
|
|
575
|
+
for (const interceptor of this.interceptors) {
|
|
576
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
return interceptorPromise.then(() => {
|
|
580
|
+
if (Object.keys(localVarFormParams).length) {
|
|
581
|
+
if (localVarUseFormData) {
|
|
582
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
583
|
+
} else {
|
|
584
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
return new Promise<{ response: http.IncomingMessage; body: WTDynamicVoucher; }>((resolve, reject) => {
|
|
588
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
589
|
+
if (error) {
|
|
590
|
+
reject(error);
|
|
591
|
+
} else {
|
|
592
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
593
|
+
body = ObjectSerializer.deserialize(body, "WTDynamicVoucher");
|
|
594
|
+
resolve({ response: response, body: body });
|
|
595
|
+
} else {
|
|
596
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
});
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
}
|