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,1484 +1,1484 @@
|
|
|
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 { CreateStaticVoucherCampaign } from '../model/createStaticVoucherCampaign';
|
|
20
|
-
import { CreateStaticVoucherCampaignWithVoucher } from '../model/createStaticVoucherCampaignWithVoucher';
|
|
21
|
-
import { CreateStaticVoucherCampaignWithVoucherWithCSV } from '../model/createStaticVoucherCampaignWithVoucherWithCSV';
|
|
22
|
-
import { FalsumError } from '../model/falsumError';
|
|
23
|
-
import { InlineObject24 } from '../model/inlineObject24';
|
|
24
|
-
import { InlineObject25 } from '../model/inlineObject25';
|
|
25
|
-
import { InlineResponse2003 } from '../model/inlineResponse2003';
|
|
26
|
-
import { InlineResponse2005 } from '../model/inlineResponse2005';
|
|
27
|
-
import { InternalServerError } from '../model/internalServerError';
|
|
28
|
-
import { ReachPerformanceStats } from '../model/reachPerformanceStats';
|
|
29
|
-
import { StaticVoucherCampaignUpdate } from '../model/staticVoucherCampaignUpdate';
|
|
30
|
-
import { UpdateStaticVoucherCampaignWithVoucher } from '../model/updateStaticVoucherCampaignWithVoucher';
|
|
31
|
-
import { VSCampaignGeneratedMessage } from '../model/vSCampaignGeneratedMessage';
|
|
32
|
-
import { VSCampaignGeneratedMessagePagination } from '../model/vSCampaignGeneratedMessagePagination';
|
|
33
|
-
import { WTStaticVoucher } from '../model/wTStaticVoucher';
|
|
34
|
-
import { WTStaticVoucherCampaign } from '../model/wTStaticVoucherCampaign';
|
|
35
|
-
import { WTWalletPageView } from '../model/wTWalletPageView';
|
|
36
|
-
|
|
37
|
-
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
38
|
-
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
39
|
-
|
|
40
|
-
import { HttpError, RequestFile } from './apis';
|
|
41
|
-
|
|
42
|
-
let defaultBasePath = 'https://api.wall.et';
|
|
43
|
-
|
|
44
|
-
// ===============================================
|
|
45
|
-
// This file is autogenerated - Please do not edit
|
|
46
|
-
// ===============================================
|
|
47
|
-
|
|
48
|
-
export enum StaticVoucherCampaignsApiApiKeys {
|
|
49
|
-
api_key,
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export class StaticVoucherCampaignsApi {
|
|
53
|
-
protected _basePath = defaultBasePath;
|
|
54
|
-
protected _defaultHeaders : any = {};
|
|
55
|
-
protected _useQuerystring : boolean = false;
|
|
56
|
-
|
|
57
|
-
protected authentications = {
|
|
58
|
-
'default': <Authentication>new VoidAuth(),
|
|
59
|
-
'api_key': new ApiKeyAuth('header', 'access-token'),
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
protected interceptors: Interceptor[] = [];
|
|
63
|
-
|
|
64
|
-
constructor(basePath?: string);
|
|
65
|
-
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
66
|
-
if (password) {
|
|
67
|
-
if (basePath) {
|
|
68
|
-
this.basePath = basePath;
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
if (basePathOrUsername) {
|
|
72
|
-
this.basePath = basePathOrUsername
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
set useQuerystring(value: boolean) {
|
|
78
|
-
this._useQuerystring = value;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
set basePath(basePath: string) {
|
|
82
|
-
this._basePath = basePath;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
set defaultHeaders(defaultHeaders: any) {
|
|
86
|
-
this._defaultHeaders = defaultHeaders;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
get defaultHeaders() {
|
|
90
|
-
return this._defaultHeaders;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
get basePath() {
|
|
94
|
-
return this._basePath;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
public setDefaultAuthentication(auth: Authentication) {
|
|
98
|
-
this.authentications.default = auth;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
public setApiKey(key: StaticVoucherCampaignsApiApiKeys, value: string) {
|
|
102
|
-
(this.authentications as any)[StaticVoucherCampaignsApiApiKeys[key]].apiKey = value;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
public addInterceptor(interceptor: Interceptor) {
|
|
106
|
-
this.interceptors.push(interceptor);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
*
|
|
111
|
-
* @summary Count loaded vouchers
|
|
112
|
-
* @param campaignID
|
|
113
|
-
*/
|
|
114
|
-
public async countVouchersLoaded (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }> {
|
|
115
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/count/vouchers/loaded/{campaignID}'
|
|
116
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
117
|
-
let localVarQueryParameters: any = {};
|
|
118
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
119
|
-
const produces = ['application/json'];
|
|
120
|
-
// give precedence to 'application/json'
|
|
121
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
122
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
123
|
-
} else {
|
|
124
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
125
|
-
}
|
|
126
|
-
let localVarFormParams: any = {};
|
|
127
|
-
|
|
128
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
129
|
-
if (campaignID === null || campaignID === undefined) {
|
|
130
|
-
throw new Error('Required parameter campaignID was null or undefined when calling countVouchersLoaded.');
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
134
|
-
|
|
135
|
-
let localVarUseFormData = false;
|
|
136
|
-
|
|
137
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
138
|
-
method: 'GET',
|
|
139
|
-
qs: localVarQueryParameters,
|
|
140
|
-
headers: localVarHeaderParams,
|
|
141
|
-
uri: localVarPath,
|
|
142
|
-
useQuerystring: this._useQuerystring,
|
|
143
|
-
json: true,
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
let authenticationPromise = Promise.resolve();
|
|
147
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
148
|
-
|
|
149
|
-
let interceptorPromise = authenticationPromise;
|
|
150
|
-
for (const interceptor of this.interceptors) {
|
|
151
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return interceptorPromise.then(() => {
|
|
155
|
-
if (Object.keys(localVarFormParams).length) {
|
|
156
|
-
if (localVarUseFormData) {
|
|
157
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
158
|
-
} else {
|
|
159
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return new Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }>((resolve, reject) => {
|
|
163
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
164
|
-
if (error) {
|
|
165
|
-
reject(error);
|
|
166
|
-
} else {
|
|
167
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
168
|
-
body = ObjectSerializer.deserialize(body, "InlineResponse2003");
|
|
169
|
-
resolve({ response: response, body: body });
|
|
170
|
-
} else {
|
|
171
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
*
|
|
180
|
-
* @summary Count redeemed vouchers
|
|
181
|
-
* @param campaignID
|
|
182
|
-
*/
|
|
183
|
-
public async countVouchersRedeemed (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }> {
|
|
184
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/count/vouchers/redeemed/{campaignID}'
|
|
185
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
186
|
-
let localVarQueryParameters: any = {};
|
|
187
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
188
|
-
const produces = ['application/json'];
|
|
189
|
-
// give precedence to 'application/json'
|
|
190
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
191
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
192
|
-
} else {
|
|
193
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
194
|
-
}
|
|
195
|
-
let localVarFormParams: any = {};
|
|
196
|
-
|
|
197
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
198
|
-
if (campaignID === null || campaignID === undefined) {
|
|
199
|
-
throw new Error('Required parameter campaignID was null or undefined when calling countVouchersRedeemed.');
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
203
|
-
|
|
204
|
-
let localVarUseFormData = false;
|
|
205
|
-
|
|
206
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
207
|
-
method: 'GET',
|
|
208
|
-
qs: localVarQueryParameters,
|
|
209
|
-
headers: localVarHeaderParams,
|
|
210
|
-
uri: localVarPath,
|
|
211
|
-
useQuerystring: this._useQuerystring,
|
|
212
|
-
json: true,
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
let authenticationPromise = Promise.resolve();
|
|
216
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
217
|
-
|
|
218
|
-
let interceptorPromise = authenticationPromise;
|
|
219
|
-
for (const interceptor of this.interceptors) {
|
|
220
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
return interceptorPromise.then(() => {
|
|
224
|
-
if (Object.keys(localVarFormParams).length) {
|
|
225
|
-
if (localVarUseFormData) {
|
|
226
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
227
|
-
} else {
|
|
228
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return new Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }>((resolve, reject) => {
|
|
232
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
233
|
-
if (error) {
|
|
234
|
-
reject(error);
|
|
235
|
-
} else {
|
|
236
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
237
|
-
body = ObjectSerializer.deserialize(body, "InlineResponse2003");
|
|
238
|
-
resolve({ response: response, body: body });
|
|
239
|
-
} else {
|
|
240
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
*
|
|
249
|
-
* @summary Create static voucher campaign
|
|
250
|
-
* @param createStaticVoucherCampaign
|
|
251
|
-
*/
|
|
252
|
-
public async createStaticVoucherCampaign (createStaticVoucherCampaign: CreateStaticVoucherCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
253
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign';
|
|
254
|
-
let localVarQueryParameters: any = {};
|
|
255
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
256
|
-
const produces = ['application/json'];
|
|
257
|
-
// give precedence to 'application/json'
|
|
258
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
259
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
260
|
-
} else {
|
|
261
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
262
|
-
}
|
|
263
|
-
let localVarFormParams: any = {};
|
|
264
|
-
|
|
265
|
-
// verify required parameter 'createStaticVoucherCampaign' is not null or undefined
|
|
266
|
-
if (createStaticVoucherCampaign === null || createStaticVoucherCampaign === undefined) {
|
|
267
|
-
throw new Error('Required parameter createStaticVoucherCampaign was null or undefined when calling createStaticVoucherCampaign.');
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
271
|
-
|
|
272
|
-
let localVarUseFormData = false;
|
|
273
|
-
|
|
274
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
275
|
-
method: 'POST',
|
|
276
|
-
qs: localVarQueryParameters,
|
|
277
|
-
headers: localVarHeaderParams,
|
|
278
|
-
uri: localVarPath,
|
|
279
|
-
useQuerystring: this._useQuerystring,
|
|
280
|
-
json: true,
|
|
281
|
-
body: ObjectSerializer.serialize(createStaticVoucherCampaign, "CreateStaticVoucherCampaign")
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
let authenticationPromise = Promise.resolve();
|
|
285
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
286
|
-
|
|
287
|
-
let interceptorPromise = authenticationPromise;
|
|
288
|
-
for (const interceptor of this.interceptors) {
|
|
289
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
return interceptorPromise.then(() => {
|
|
293
|
-
if (Object.keys(localVarFormParams).length) {
|
|
294
|
-
if (localVarUseFormData) {
|
|
295
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
296
|
-
} else {
|
|
297
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
301
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
302
|
-
if (error) {
|
|
303
|
-
reject(error);
|
|
304
|
-
} else {
|
|
305
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
306
|
-
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
307
|
-
resolve({ response: response, body: body });
|
|
308
|
-
} else {
|
|
309
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
});
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
*
|
|
318
|
-
* @summary Import static voucher campaign
|
|
319
|
-
* @param createStaticVoucherCampaignWithVoucherWithCSV
|
|
320
|
-
*/
|
|
321
|
-
public async createStaticVoucherCampaignFromCSV (createStaticVoucherCampaignWithVoucherWithCSV: CreateStaticVoucherCampaignWithVoucherWithCSV, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
322
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/csv';
|
|
323
|
-
let localVarQueryParameters: any = {};
|
|
324
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
325
|
-
const produces = ['application/json'];
|
|
326
|
-
// give precedence to 'application/json'
|
|
327
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
328
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
329
|
-
} else {
|
|
330
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
331
|
-
}
|
|
332
|
-
let localVarFormParams: any = {};
|
|
333
|
-
|
|
334
|
-
// verify required parameter 'createStaticVoucherCampaignWithVoucherWithCSV' is not null or undefined
|
|
335
|
-
if (createStaticVoucherCampaignWithVoucherWithCSV === null || createStaticVoucherCampaignWithVoucherWithCSV === undefined) {
|
|
336
|
-
throw new Error('Required parameter createStaticVoucherCampaignWithVoucherWithCSV was null or undefined when calling createStaticVoucherCampaignFromCSV.');
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
340
|
-
|
|
341
|
-
let localVarUseFormData = false;
|
|
342
|
-
|
|
343
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
344
|
-
method: 'POST',
|
|
345
|
-
qs: localVarQueryParameters,
|
|
346
|
-
headers: localVarHeaderParams,
|
|
347
|
-
uri: localVarPath,
|
|
348
|
-
useQuerystring: this._useQuerystring,
|
|
349
|
-
json: true,
|
|
350
|
-
body: ObjectSerializer.serialize(createStaticVoucherCampaignWithVoucherWithCSV, "CreateStaticVoucherCampaignWithVoucherWithCSV")
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
let authenticationPromise = Promise.resolve();
|
|
354
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
355
|
-
|
|
356
|
-
let interceptorPromise = authenticationPromise;
|
|
357
|
-
for (const interceptor of this.interceptors) {
|
|
358
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
return interceptorPromise.then(() => {
|
|
362
|
-
if (Object.keys(localVarFormParams).length) {
|
|
363
|
-
if (localVarUseFormData) {
|
|
364
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
365
|
-
} else {
|
|
366
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
370
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
371
|
-
if (error) {
|
|
372
|
-
reject(error);
|
|
373
|
-
} else {
|
|
374
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
375
|
-
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
376
|
-
resolve({ response: response, body: body });
|
|
377
|
-
} else {
|
|
378
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
});
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
/**
|
|
386
|
-
*
|
|
387
|
-
* @summary Create static voucher campaign with voucher
|
|
388
|
-
* @param createStaticVoucherCampaignWithVoucher
|
|
389
|
-
*/
|
|
390
|
-
public async createStaticVoucherCampaignWithVoucher (createStaticVoucherCampaignWithVoucher: CreateStaticVoucherCampaignWithVoucher, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
391
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/voucher';
|
|
392
|
-
let localVarQueryParameters: any = {};
|
|
393
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
394
|
-
const produces = ['application/json'];
|
|
395
|
-
// give precedence to 'application/json'
|
|
396
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
397
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
398
|
-
} else {
|
|
399
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
400
|
-
}
|
|
401
|
-
let localVarFormParams: any = {};
|
|
402
|
-
|
|
403
|
-
// verify required parameter 'createStaticVoucherCampaignWithVoucher' is not null or undefined
|
|
404
|
-
if (createStaticVoucherCampaignWithVoucher === null || createStaticVoucherCampaignWithVoucher === undefined) {
|
|
405
|
-
throw new Error('Required parameter createStaticVoucherCampaignWithVoucher was null or undefined when calling createStaticVoucherCampaignWithVoucher.');
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
409
|
-
|
|
410
|
-
let localVarUseFormData = false;
|
|
411
|
-
|
|
412
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
413
|
-
method: 'POST',
|
|
414
|
-
qs: localVarQueryParameters,
|
|
415
|
-
headers: localVarHeaderParams,
|
|
416
|
-
uri: localVarPath,
|
|
417
|
-
useQuerystring: this._useQuerystring,
|
|
418
|
-
json: true,
|
|
419
|
-
body: ObjectSerializer.serialize(createStaticVoucherCampaignWithVoucher, "CreateStaticVoucherCampaignWithVoucher")
|
|
420
|
-
};
|
|
421
|
-
|
|
422
|
-
let authenticationPromise = Promise.resolve();
|
|
423
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
424
|
-
|
|
425
|
-
let interceptorPromise = authenticationPromise;
|
|
426
|
-
for (const interceptor of this.interceptors) {
|
|
427
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
return interceptorPromise.then(() => {
|
|
431
|
-
if (Object.keys(localVarFormParams).length) {
|
|
432
|
-
if (localVarUseFormData) {
|
|
433
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
434
|
-
} else {
|
|
435
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
439
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
440
|
-
if (error) {
|
|
441
|
-
reject(error);
|
|
442
|
-
} else {
|
|
443
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
444
|
-
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
445
|
-
resolve({ response: response, body: body });
|
|
446
|
-
} else {
|
|
447
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
});
|
|
451
|
-
});
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
|
-
/**
|
|
455
|
-
*
|
|
456
|
-
* @summary Duplicate static voucher campaign
|
|
457
|
-
* @param campaignID
|
|
458
|
-
*/
|
|
459
|
-
public async duplicateStaticVoucherCampaignById (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
460
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/duplicate/{campaignID}'
|
|
461
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
462
|
-
let localVarQueryParameters: any = {};
|
|
463
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
464
|
-
const produces = ['application/json'];
|
|
465
|
-
// give precedence to 'application/json'
|
|
466
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
467
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
468
|
-
} else {
|
|
469
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
470
|
-
}
|
|
471
|
-
let localVarFormParams: any = {};
|
|
472
|
-
|
|
473
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
474
|
-
if (campaignID === null || campaignID === undefined) {
|
|
475
|
-
throw new Error('Required parameter campaignID was null or undefined when calling duplicateStaticVoucherCampaignById.');
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
479
|
-
|
|
480
|
-
let localVarUseFormData = false;
|
|
481
|
-
|
|
482
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
483
|
-
method: 'POST',
|
|
484
|
-
qs: localVarQueryParameters,
|
|
485
|
-
headers: localVarHeaderParams,
|
|
486
|
-
uri: localVarPath,
|
|
487
|
-
useQuerystring: this._useQuerystring,
|
|
488
|
-
json: true,
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
let authenticationPromise = Promise.resolve();
|
|
492
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
493
|
-
|
|
494
|
-
let interceptorPromise = authenticationPromise;
|
|
495
|
-
for (const interceptor of this.interceptors) {
|
|
496
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
return interceptorPromise.then(() => {
|
|
500
|
-
if (Object.keys(localVarFormParams).length) {
|
|
501
|
-
if (localVarUseFormData) {
|
|
502
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
503
|
-
} else {
|
|
504
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
508
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
509
|
-
if (error) {
|
|
510
|
-
reject(error);
|
|
511
|
-
} else {
|
|
512
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
513
|
-
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
514
|
-
resolve({ response: response, body: body });
|
|
515
|
-
} else {
|
|
516
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
});
|
|
520
|
-
});
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
/**
|
|
524
|
-
*
|
|
525
|
-
* @summary Fetch performance overview
|
|
526
|
-
* @param campaignID
|
|
527
|
-
*/
|
|
528
|
-
public async fetchPerformanceOverview (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
529
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/overview/performance/{campaignID}'
|
|
530
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
531
|
-
let localVarQueryParameters: any = {};
|
|
532
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
533
|
-
const produces = ['application/json'];
|
|
534
|
-
// give precedence to 'application/json'
|
|
535
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
536
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
537
|
-
} else {
|
|
538
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
539
|
-
}
|
|
540
|
-
let localVarFormParams: any = {};
|
|
541
|
-
|
|
542
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
543
|
-
if (campaignID === null || campaignID === undefined) {
|
|
544
|
-
throw new Error('Required parameter campaignID was null or undefined when calling fetchPerformanceOverview.');
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
548
|
-
|
|
549
|
-
let localVarUseFormData = false;
|
|
550
|
-
|
|
551
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
552
|
-
method: 'GET',
|
|
553
|
-
qs: localVarQueryParameters,
|
|
554
|
-
headers: localVarHeaderParams,
|
|
555
|
-
uri: localVarPath,
|
|
556
|
-
useQuerystring: this._useQuerystring,
|
|
557
|
-
json: true,
|
|
558
|
-
};
|
|
559
|
-
|
|
560
|
-
let authenticationPromise = Promise.resolve();
|
|
561
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
562
|
-
|
|
563
|
-
let interceptorPromise = authenticationPromise;
|
|
564
|
-
for (const interceptor of this.interceptors) {
|
|
565
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
return interceptorPromise.then(() => {
|
|
569
|
-
if (Object.keys(localVarFormParams).length) {
|
|
570
|
-
if (localVarUseFormData) {
|
|
571
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
572
|
-
} else {
|
|
573
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
577
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
578
|
-
if (error) {
|
|
579
|
-
reject(error);
|
|
580
|
-
} else {
|
|
581
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
582
|
-
body = ObjectSerializer.deserialize(body, "object");
|
|
583
|
-
resolve({ response: response, body: body });
|
|
584
|
-
} else {
|
|
585
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
});
|
|
589
|
-
});
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
/**
|
|
593
|
-
*
|
|
594
|
-
* @summary Get the reach statistics of all the static voucher campaigns
|
|
595
|
-
* @param broadcastScheduledStartAt
|
|
596
|
-
* @param broadcastScheduledEndAt
|
|
597
|
-
*/
|
|
598
|
-
public async fetchReachStatsOfAllStaticVoucherCampaigns (broadcastScheduledStartAt?: Date, broadcastScheduledEndAt?: Date, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }> {
|
|
599
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/reach/all';
|
|
600
|
-
let localVarQueryParameters: any = {};
|
|
601
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
602
|
-
const produces = ['application/json'];
|
|
603
|
-
// give precedence to 'application/json'
|
|
604
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
605
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
606
|
-
} else {
|
|
607
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
608
|
-
}
|
|
609
|
-
let localVarFormParams: any = {};
|
|
610
|
-
|
|
611
|
-
if (broadcastScheduledStartAt !== undefined) {
|
|
612
|
-
localVarQueryParameters['broadcastScheduledStartAt'] = ObjectSerializer.serialize(broadcastScheduledStartAt, "Date");
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
if (broadcastScheduledEndAt !== undefined) {
|
|
616
|
-
localVarQueryParameters['broadcastScheduledEndAt'] = ObjectSerializer.serialize(broadcastScheduledEndAt, "Date");
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
620
|
-
|
|
621
|
-
let localVarUseFormData = false;
|
|
622
|
-
|
|
623
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
624
|
-
method: 'GET',
|
|
625
|
-
qs: localVarQueryParameters,
|
|
626
|
-
headers: localVarHeaderParams,
|
|
627
|
-
uri: localVarPath,
|
|
628
|
-
useQuerystring: this._useQuerystring,
|
|
629
|
-
json: true,
|
|
630
|
-
};
|
|
631
|
-
|
|
632
|
-
let authenticationPromise = Promise.resolve();
|
|
633
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
634
|
-
|
|
635
|
-
let interceptorPromise = authenticationPromise;
|
|
636
|
-
for (const interceptor of this.interceptors) {
|
|
637
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
return interceptorPromise.then(() => {
|
|
641
|
-
if (Object.keys(localVarFormParams).length) {
|
|
642
|
-
if (localVarUseFormData) {
|
|
643
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
644
|
-
} else {
|
|
645
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
return new Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }>((resolve, reject) => {
|
|
649
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
650
|
-
if (error) {
|
|
651
|
-
reject(error);
|
|
652
|
-
} else {
|
|
653
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
654
|
-
body = ObjectSerializer.deserialize(body, "ReachPerformanceStats");
|
|
655
|
-
resolve({ response: response, body: body });
|
|
656
|
-
} else {
|
|
657
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
});
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
/**
|
|
665
|
-
*
|
|
666
|
-
* @summary Get the reach statistics of an individual static voucher campaign
|
|
667
|
-
* @param staticVoucherCampaignID
|
|
668
|
-
* @param broadcastScheduledStartAt
|
|
669
|
-
* @param broadcastScheduledEndAt
|
|
670
|
-
*/
|
|
671
|
-
public async fetchReachStatsOfIndividualStaticVoucherCampaign (staticVoucherCampaignID: any, broadcastScheduledStartAt?: Date, broadcastScheduledEndAt?: Date, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }> {
|
|
672
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/reach/{staticVoucherCampaignID}'
|
|
673
|
-
.replace('{' + 'staticVoucherCampaignID' + '}', encodeURIComponent(String(staticVoucherCampaignID)));
|
|
674
|
-
let localVarQueryParameters: any = {};
|
|
675
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
676
|
-
const produces = ['application/json'];
|
|
677
|
-
// give precedence to 'application/json'
|
|
678
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
679
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
680
|
-
} else {
|
|
681
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
682
|
-
}
|
|
683
|
-
let localVarFormParams: any = {};
|
|
684
|
-
|
|
685
|
-
// verify required parameter 'staticVoucherCampaignID' is not null or undefined
|
|
686
|
-
if (staticVoucherCampaignID === null || staticVoucherCampaignID === undefined) {
|
|
687
|
-
throw new Error('Required parameter staticVoucherCampaignID was null or undefined when calling fetchReachStatsOfIndividualStaticVoucherCampaign.');
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
if (broadcastScheduledStartAt !== undefined) {
|
|
691
|
-
localVarQueryParameters['broadcastScheduledStartAt'] = ObjectSerializer.serialize(broadcastScheduledStartAt, "Date");
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
if (broadcastScheduledEndAt !== undefined) {
|
|
695
|
-
localVarQueryParameters['broadcastScheduledEndAt'] = ObjectSerializer.serialize(broadcastScheduledEndAt, "Date");
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
699
|
-
|
|
700
|
-
let localVarUseFormData = false;
|
|
701
|
-
|
|
702
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
703
|
-
method: 'GET',
|
|
704
|
-
qs: localVarQueryParameters,
|
|
705
|
-
headers: localVarHeaderParams,
|
|
706
|
-
uri: localVarPath,
|
|
707
|
-
useQuerystring: this._useQuerystring,
|
|
708
|
-
json: true,
|
|
709
|
-
};
|
|
710
|
-
|
|
711
|
-
let authenticationPromise = Promise.resolve();
|
|
712
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
713
|
-
|
|
714
|
-
let interceptorPromise = authenticationPromise;
|
|
715
|
-
for (const interceptor of this.interceptors) {
|
|
716
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
return interceptorPromise.then(() => {
|
|
720
|
-
if (Object.keys(localVarFormParams).length) {
|
|
721
|
-
if (localVarUseFormData) {
|
|
722
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
723
|
-
} else {
|
|
724
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
return new Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }>((resolve, reject) => {
|
|
728
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
729
|
-
if (error) {
|
|
730
|
-
reject(error);
|
|
731
|
-
} else {
|
|
732
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
733
|
-
body = ObjectSerializer.deserialize(body, "ReachPerformanceStats");
|
|
734
|
-
resolve({ response: response, body: body });
|
|
735
|
-
} else {
|
|
736
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
});
|
|
740
|
-
});
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
/**
|
|
744
|
-
*
|
|
745
|
-
* @summary Fetch static voucher campaign
|
|
746
|
-
* @param id
|
|
747
|
-
*/
|
|
748
|
-
public async fetchStaticVoucherCampaignById (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
749
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/{id}'
|
|
750
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
751
|
-
let localVarQueryParameters: any = {};
|
|
752
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
753
|
-
const produces = ['application/json'];
|
|
754
|
-
// give precedence to 'application/json'
|
|
755
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
756
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
757
|
-
} else {
|
|
758
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
759
|
-
}
|
|
760
|
-
let localVarFormParams: any = {};
|
|
761
|
-
|
|
762
|
-
// verify required parameter 'id' is not null or undefined
|
|
763
|
-
if (id === null || id === undefined) {
|
|
764
|
-
throw new Error('Required parameter id was null or undefined when calling fetchStaticVoucherCampaignById.');
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
768
|
-
|
|
769
|
-
let localVarUseFormData = false;
|
|
770
|
-
|
|
771
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
772
|
-
method: 'GET',
|
|
773
|
-
qs: localVarQueryParameters,
|
|
774
|
-
headers: localVarHeaderParams,
|
|
775
|
-
uri: localVarPath,
|
|
776
|
-
useQuerystring: this._useQuerystring,
|
|
777
|
-
json: true,
|
|
778
|
-
};
|
|
779
|
-
|
|
780
|
-
let authenticationPromise = Promise.resolve();
|
|
781
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
782
|
-
|
|
783
|
-
let interceptorPromise = authenticationPromise;
|
|
784
|
-
for (const interceptor of this.interceptors) {
|
|
785
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
return interceptorPromise.then(() => {
|
|
789
|
-
if (Object.keys(localVarFormParams).length) {
|
|
790
|
-
if (localVarUseFormData) {
|
|
791
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
792
|
-
} else {
|
|
793
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
797
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
798
|
-
if (error) {
|
|
799
|
-
reject(error);
|
|
800
|
-
} else {
|
|
801
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
802
|
-
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
803
|
-
resolve({ response: response, body: body });
|
|
804
|
-
} else {
|
|
805
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
});
|
|
809
|
-
});
|
|
810
|
-
});
|
|
811
|
-
}
|
|
812
|
-
/**
|
|
813
|
-
*
|
|
814
|
-
* @summary Fetches all static vouchers campaigns
|
|
815
|
-
* @param isArchiveIncluded
|
|
816
|
-
* @param sourceID
|
|
817
|
-
*/
|
|
818
|
-
public async fetchStaticVoucherCampaigns (isArchiveIncluded?: boolean, sourceID?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucherCampaign>; }> {
|
|
819
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/all';
|
|
820
|
-
let localVarQueryParameters: any = {};
|
|
821
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
822
|
-
const produces = ['application/json'];
|
|
823
|
-
// give precedence to 'application/json'
|
|
824
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
825
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
826
|
-
} else {
|
|
827
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
828
|
-
}
|
|
829
|
-
let localVarFormParams: any = {};
|
|
830
|
-
|
|
831
|
-
if (isArchiveIncluded !== undefined) {
|
|
832
|
-
localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
if (sourceID !== undefined) {
|
|
836
|
-
localVarQueryParameters['sourceID'] = ObjectSerializer.serialize(sourceID, "number");
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
840
|
-
|
|
841
|
-
let localVarUseFormData = false;
|
|
842
|
-
|
|
843
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
844
|
-
method: 'GET',
|
|
845
|
-
qs: localVarQueryParameters,
|
|
846
|
-
headers: localVarHeaderParams,
|
|
847
|
-
uri: localVarPath,
|
|
848
|
-
useQuerystring: this._useQuerystring,
|
|
849
|
-
json: true,
|
|
850
|
-
};
|
|
851
|
-
|
|
852
|
-
let authenticationPromise = Promise.resolve();
|
|
853
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
854
|
-
|
|
855
|
-
let interceptorPromise = authenticationPromise;
|
|
856
|
-
for (const interceptor of this.interceptors) {
|
|
857
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
return interceptorPromise.then(() => {
|
|
861
|
-
if (Object.keys(localVarFormParams).length) {
|
|
862
|
-
if (localVarUseFormData) {
|
|
863
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
864
|
-
} else {
|
|
865
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
866
|
-
}
|
|
867
|
-
}
|
|
868
|
-
return new Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucherCampaign>; }>((resolve, reject) => {
|
|
869
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
870
|
-
if (error) {
|
|
871
|
-
reject(error);
|
|
872
|
-
} else {
|
|
873
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
874
|
-
body = ObjectSerializer.deserialize(body, "Array<WTStaticVoucherCampaign>");
|
|
875
|
-
resolve({ response: response, body: body });
|
|
876
|
-
} else {
|
|
877
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
});
|
|
881
|
-
});
|
|
882
|
-
});
|
|
883
|
-
}
|
|
884
|
-
/**
|
|
885
|
-
*
|
|
886
|
-
* @summary Fetch static vouchers
|
|
887
|
-
* @param campaignID
|
|
888
|
-
*/
|
|
889
|
-
public async fetchStaticVouchers (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucher>; }> {
|
|
890
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/staticVouchers/{campaignID}'
|
|
891
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
892
|
-
let localVarQueryParameters: any = {};
|
|
893
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
894
|
-
const produces = ['application/json'];
|
|
895
|
-
// give precedence to 'application/json'
|
|
896
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
897
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
898
|
-
} else {
|
|
899
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
900
|
-
}
|
|
901
|
-
let localVarFormParams: any = {};
|
|
902
|
-
|
|
903
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
904
|
-
if (campaignID === null || campaignID === undefined) {
|
|
905
|
-
throw new Error('Required parameter campaignID was null or undefined when calling fetchStaticVouchers.');
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
909
|
-
|
|
910
|
-
let localVarUseFormData = false;
|
|
911
|
-
|
|
912
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
913
|
-
method: 'GET',
|
|
914
|
-
qs: localVarQueryParameters,
|
|
915
|
-
headers: localVarHeaderParams,
|
|
916
|
-
uri: localVarPath,
|
|
917
|
-
useQuerystring: this._useQuerystring,
|
|
918
|
-
json: true,
|
|
919
|
-
};
|
|
920
|
-
|
|
921
|
-
let authenticationPromise = Promise.resolve();
|
|
922
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
923
|
-
|
|
924
|
-
let interceptorPromise = authenticationPromise;
|
|
925
|
-
for (const interceptor of this.interceptors) {
|
|
926
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
return interceptorPromise.then(() => {
|
|
930
|
-
if (Object.keys(localVarFormParams).length) {
|
|
931
|
-
if (localVarUseFormData) {
|
|
932
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
933
|
-
} else {
|
|
934
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
return new Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucher>; }>((resolve, reject) => {
|
|
938
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
939
|
-
if (error) {
|
|
940
|
-
reject(error);
|
|
941
|
-
} else {
|
|
942
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
943
|
-
body = ObjectSerializer.deserialize(body, "Array<WTStaticVoucher>");
|
|
944
|
-
resolve({ response: response, body: body });
|
|
945
|
-
} else {
|
|
946
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
});
|
|
950
|
-
});
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
/**
|
|
954
|
-
*
|
|
955
|
-
* @summary Fetch static vouchers by page
|
|
956
|
-
* @param campaignID
|
|
957
|
-
* @param pagenum
|
|
958
|
-
* @param pagesize
|
|
959
|
-
*/
|
|
960
|
-
public async fetchStaticVouchersPage (campaignID: any, pagenum: number, pagesize: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InlineResponse2005; }> {
|
|
961
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/staticVouchers/page/{campaignID}'
|
|
962
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
963
|
-
let localVarQueryParameters: any = {};
|
|
964
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
965
|
-
const produces = ['application/json'];
|
|
966
|
-
// give precedence to 'application/json'
|
|
967
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
968
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
969
|
-
} else {
|
|
970
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
971
|
-
}
|
|
972
|
-
let localVarFormParams: any = {};
|
|
973
|
-
|
|
974
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
975
|
-
if (campaignID === null || campaignID === undefined) {
|
|
976
|
-
throw new Error('Required parameter campaignID was null or undefined when calling fetchStaticVouchersPage.');
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
// verify required parameter 'pagenum' is not null or undefined
|
|
980
|
-
if (pagenum === null || pagenum === undefined) {
|
|
981
|
-
throw new Error('Required parameter pagenum was null or undefined when calling fetchStaticVouchersPage.');
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
// verify required parameter 'pagesize' is not null or undefined
|
|
985
|
-
if (pagesize === null || pagesize === undefined) {
|
|
986
|
-
throw new Error('Required parameter pagesize was null or undefined when calling fetchStaticVouchersPage.');
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
if (pagenum !== undefined) {
|
|
990
|
-
localVarQueryParameters['pagenum'] = ObjectSerializer.serialize(pagenum, "number");
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
if (pagesize !== undefined) {
|
|
994
|
-
localVarQueryParameters['pagesize'] = ObjectSerializer.serialize(pagesize, "number");
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
998
|
-
|
|
999
|
-
let localVarUseFormData = false;
|
|
1000
|
-
|
|
1001
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
1002
|
-
method: 'GET',
|
|
1003
|
-
qs: localVarQueryParameters,
|
|
1004
|
-
headers: localVarHeaderParams,
|
|
1005
|
-
uri: localVarPath,
|
|
1006
|
-
useQuerystring: this._useQuerystring,
|
|
1007
|
-
json: true,
|
|
1008
|
-
};
|
|
1009
|
-
|
|
1010
|
-
let authenticationPromise = Promise.resolve();
|
|
1011
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1012
|
-
|
|
1013
|
-
let interceptorPromise = authenticationPromise;
|
|
1014
|
-
for (const interceptor of this.interceptors) {
|
|
1015
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
return interceptorPromise.then(() => {
|
|
1019
|
-
if (Object.keys(localVarFormParams).length) {
|
|
1020
|
-
if (localVarUseFormData) {
|
|
1021
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1022
|
-
} else {
|
|
1023
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
return new Promise<{ response: http.IncomingMessage; body: InlineResponse2005; }>((resolve, reject) => {
|
|
1027
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1028
|
-
if (error) {
|
|
1029
|
-
reject(error);
|
|
1030
|
-
} else {
|
|
1031
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1032
|
-
body = ObjectSerializer.deserialize(body, "InlineResponse2005");
|
|
1033
|
-
resolve({ response: response, body: body });
|
|
1034
|
-
} else {
|
|
1035
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
});
|
|
1039
|
-
});
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
1042
|
-
/**
|
|
1043
|
-
*
|
|
1044
|
-
* @summary Fetch views
|
|
1045
|
-
* @param campaignID
|
|
1046
|
-
*/
|
|
1047
|
-
public async fetchViews (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTWalletPageView>; }> {
|
|
1048
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/views/{campaignID}'
|
|
1049
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1050
|
-
let localVarQueryParameters: any = {};
|
|
1051
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1052
|
-
const produces = ['application/json'];
|
|
1053
|
-
// give precedence to 'application/json'
|
|
1054
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
1055
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
1056
|
-
} else {
|
|
1057
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
1058
|
-
}
|
|
1059
|
-
let localVarFormParams: any = {};
|
|
1060
|
-
|
|
1061
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
1062
|
-
if (campaignID === null || campaignID === undefined) {
|
|
1063
|
-
throw new Error('Required parameter campaignID was null or undefined when calling fetchViews.');
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1067
|
-
|
|
1068
|
-
let localVarUseFormData = false;
|
|
1069
|
-
|
|
1070
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
1071
|
-
method: 'GET',
|
|
1072
|
-
qs: localVarQueryParameters,
|
|
1073
|
-
headers: localVarHeaderParams,
|
|
1074
|
-
uri: localVarPath,
|
|
1075
|
-
useQuerystring: this._useQuerystring,
|
|
1076
|
-
json: true,
|
|
1077
|
-
};
|
|
1078
|
-
|
|
1079
|
-
let authenticationPromise = Promise.resolve();
|
|
1080
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1081
|
-
|
|
1082
|
-
let interceptorPromise = authenticationPromise;
|
|
1083
|
-
for (const interceptor of this.interceptors) {
|
|
1084
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
return interceptorPromise.then(() => {
|
|
1088
|
-
if (Object.keys(localVarFormParams).length) {
|
|
1089
|
-
if (localVarUseFormData) {
|
|
1090
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1091
|
-
} else {
|
|
1092
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
return new Promise<{ response: http.IncomingMessage; body: Array<WTWalletPageView>; }>((resolve, reject) => {
|
|
1096
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1097
|
-
if (error) {
|
|
1098
|
-
reject(error);
|
|
1099
|
-
} else {
|
|
1100
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1101
|
-
body = ObjectSerializer.deserialize(body, "Array<WTWalletPageView>");
|
|
1102
|
-
resolve({ response: response, body: body });
|
|
1103
|
-
} else {
|
|
1104
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
|
-
});
|
|
1108
|
-
});
|
|
1109
|
-
});
|
|
1110
|
-
}
|
|
1111
|
-
/**
|
|
1112
|
-
*
|
|
1113
|
-
* @summary Fetch redeemed vouchers
|
|
1114
|
-
* @param campaignID
|
|
1115
|
-
*/
|
|
1116
|
-
public async fetchVouchersRedeemed (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucher>; }> {
|
|
1117
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/vouchers/redeemed/{campaignID}'
|
|
1118
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1119
|
-
let localVarQueryParameters: any = {};
|
|
1120
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1121
|
-
const produces = ['application/json'];
|
|
1122
|
-
// give precedence to 'application/json'
|
|
1123
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
1124
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
1125
|
-
} else {
|
|
1126
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
1127
|
-
}
|
|
1128
|
-
let localVarFormParams: any = {};
|
|
1129
|
-
|
|
1130
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
1131
|
-
if (campaignID === null || campaignID === undefined) {
|
|
1132
|
-
throw new Error('Required parameter campaignID was null or undefined when calling fetchVouchersRedeemed.');
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1136
|
-
|
|
1137
|
-
let localVarUseFormData = false;
|
|
1138
|
-
|
|
1139
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
1140
|
-
method: 'GET',
|
|
1141
|
-
qs: localVarQueryParameters,
|
|
1142
|
-
headers: localVarHeaderParams,
|
|
1143
|
-
uri: localVarPath,
|
|
1144
|
-
useQuerystring: this._useQuerystring,
|
|
1145
|
-
json: true,
|
|
1146
|
-
};
|
|
1147
|
-
|
|
1148
|
-
let authenticationPromise = Promise.resolve();
|
|
1149
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1150
|
-
|
|
1151
|
-
let interceptorPromise = authenticationPromise;
|
|
1152
|
-
for (const interceptor of this.interceptors) {
|
|
1153
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
return interceptorPromise.then(() => {
|
|
1157
|
-
if (Object.keys(localVarFormParams).length) {
|
|
1158
|
-
if (localVarUseFormData) {
|
|
1159
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1160
|
-
} else {
|
|
1161
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
return new Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucher>; }>((resolve, reject) => {
|
|
1165
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1166
|
-
if (error) {
|
|
1167
|
-
reject(error);
|
|
1168
|
-
} else {
|
|
1169
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1170
|
-
body = ObjectSerializer.deserialize(body, "Array<WTStaticVoucher>");
|
|
1171
|
-
resolve({ response: response, body: body });
|
|
1172
|
-
} else {
|
|
1173
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
});
|
|
1177
|
-
});
|
|
1178
|
-
});
|
|
1179
|
-
}
|
|
1180
|
-
/**
|
|
1181
|
-
*
|
|
1182
|
-
* @summary Preview static vouchers. This method has been deprecated. Please use /preview/page/{campaignID} for better performance.
|
|
1183
|
-
* @param campaignID
|
|
1184
|
-
* @param inlineObject24
|
|
1185
|
-
*/
|
|
1186
|
-
public async previewMessages (campaignID: any, inlineObject24: InlineObject24, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<VSCampaignGeneratedMessage>; }> {
|
|
1187
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/preview/{campaignID}'
|
|
1188
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1189
|
-
let localVarQueryParameters: any = {};
|
|
1190
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1191
|
-
const produces = ['application/json'];
|
|
1192
|
-
// give precedence to 'application/json'
|
|
1193
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
1194
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
1195
|
-
} else {
|
|
1196
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
1197
|
-
}
|
|
1198
|
-
let localVarFormParams: any = {};
|
|
1199
|
-
|
|
1200
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
1201
|
-
if (campaignID === null || campaignID === undefined) {
|
|
1202
|
-
throw new Error('Required parameter campaignID was null or undefined when calling previewMessages.');
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
// verify required parameter 'inlineObject24' is not null or undefined
|
|
1206
|
-
if (inlineObject24 === null || inlineObject24 === undefined) {
|
|
1207
|
-
throw new Error('Required parameter inlineObject24 was null or undefined when calling previewMessages.');
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1211
|
-
|
|
1212
|
-
let localVarUseFormData = false;
|
|
1213
|
-
|
|
1214
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
1215
|
-
method: 'PUT',
|
|
1216
|
-
qs: localVarQueryParameters,
|
|
1217
|
-
headers: localVarHeaderParams,
|
|
1218
|
-
uri: localVarPath,
|
|
1219
|
-
useQuerystring: this._useQuerystring,
|
|
1220
|
-
json: true,
|
|
1221
|
-
body: ObjectSerializer.serialize(inlineObject24, "InlineObject24")
|
|
1222
|
-
};
|
|
1223
|
-
|
|
1224
|
-
let authenticationPromise = Promise.resolve();
|
|
1225
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1226
|
-
|
|
1227
|
-
let interceptorPromise = authenticationPromise;
|
|
1228
|
-
for (const interceptor of this.interceptors) {
|
|
1229
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
return interceptorPromise.then(() => {
|
|
1233
|
-
if (Object.keys(localVarFormParams).length) {
|
|
1234
|
-
if (localVarUseFormData) {
|
|
1235
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1236
|
-
} else {
|
|
1237
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
return new Promise<{ response: http.IncomingMessage; body: Array<VSCampaignGeneratedMessage>; }>((resolve, reject) => {
|
|
1241
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1242
|
-
if (error) {
|
|
1243
|
-
reject(error);
|
|
1244
|
-
} else {
|
|
1245
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1246
|
-
body = ObjectSerializer.deserialize(body, "Array<VSCampaignGeneratedMessage>");
|
|
1247
|
-
resolve({ response: response, body: body });
|
|
1248
|
-
} else {
|
|
1249
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
1250
|
-
}
|
|
1251
|
-
}
|
|
1252
|
-
});
|
|
1253
|
-
});
|
|
1254
|
-
});
|
|
1255
|
-
}
|
|
1256
|
-
/**
|
|
1257
|
-
*
|
|
1258
|
-
* @summary Preview static vouchers by page
|
|
1259
|
-
* @param campaignID
|
|
1260
|
-
* @param inlineObject25
|
|
1261
|
-
*/
|
|
1262
|
-
public async previewMessagesByPage (campaignID: any, inlineObject25: InlineObject25, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: VSCampaignGeneratedMessagePagination; }> {
|
|
1263
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/preview/page/{campaignID}'
|
|
1264
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1265
|
-
let localVarQueryParameters: any = {};
|
|
1266
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1267
|
-
const produces = ['application/json'];
|
|
1268
|
-
// give precedence to 'application/json'
|
|
1269
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
1270
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
1271
|
-
} else {
|
|
1272
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
1273
|
-
}
|
|
1274
|
-
let localVarFormParams: any = {};
|
|
1275
|
-
|
|
1276
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
1277
|
-
if (campaignID === null || campaignID === undefined) {
|
|
1278
|
-
throw new Error('Required parameter campaignID was null or undefined when calling previewMessagesByPage.');
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
// verify required parameter 'inlineObject25' is not null or undefined
|
|
1282
|
-
if (inlineObject25 === null || inlineObject25 === undefined) {
|
|
1283
|
-
throw new Error('Required parameter inlineObject25 was null or undefined when calling previewMessagesByPage.');
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1287
|
-
|
|
1288
|
-
let localVarUseFormData = false;
|
|
1289
|
-
|
|
1290
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
1291
|
-
method: 'PUT',
|
|
1292
|
-
qs: localVarQueryParameters,
|
|
1293
|
-
headers: localVarHeaderParams,
|
|
1294
|
-
uri: localVarPath,
|
|
1295
|
-
useQuerystring: this._useQuerystring,
|
|
1296
|
-
json: true,
|
|
1297
|
-
body: ObjectSerializer.serialize(inlineObject25, "InlineObject25")
|
|
1298
|
-
};
|
|
1299
|
-
|
|
1300
|
-
let authenticationPromise = Promise.resolve();
|
|
1301
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1302
|
-
|
|
1303
|
-
let interceptorPromise = authenticationPromise;
|
|
1304
|
-
for (const interceptor of this.interceptors) {
|
|
1305
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
return interceptorPromise.then(() => {
|
|
1309
|
-
if (Object.keys(localVarFormParams).length) {
|
|
1310
|
-
if (localVarUseFormData) {
|
|
1311
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1312
|
-
} else {
|
|
1313
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
return new Promise<{ response: http.IncomingMessage; body: VSCampaignGeneratedMessagePagination; }>((resolve, reject) => {
|
|
1317
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1318
|
-
if (error) {
|
|
1319
|
-
reject(error);
|
|
1320
|
-
} else {
|
|
1321
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1322
|
-
body = ObjectSerializer.deserialize(body, "VSCampaignGeneratedMessagePagination");
|
|
1323
|
-
resolve({ response: response, body: body });
|
|
1324
|
-
} else {
|
|
1325
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
});
|
|
1329
|
-
});
|
|
1330
|
-
});
|
|
1331
|
-
}
|
|
1332
|
-
/**
|
|
1333
|
-
*
|
|
1334
|
-
* @summary Update static voucher campaign
|
|
1335
|
-
* @param campaignID
|
|
1336
|
-
* @param staticVoucherCampaignUpdate
|
|
1337
|
-
*/
|
|
1338
|
-
public async updateStaticVoucherCampaign (campaignID: any, staticVoucherCampaignUpdate: StaticVoucherCampaignUpdate, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
1339
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/{campaignID}'
|
|
1340
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1341
|
-
let localVarQueryParameters: any = {};
|
|
1342
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1343
|
-
const produces = ['application/json'];
|
|
1344
|
-
// give precedence to 'application/json'
|
|
1345
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
1346
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
1347
|
-
} else {
|
|
1348
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
1349
|
-
}
|
|
1350
|
-
let localVarFormParams: any = {};
|
|
1351
|
-
|
|
1352
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
1353
|
-
if (campaignID === null || campaignID === undefined) {
|
|
1354
|
-
throw new Error('Required parameter campaignID was null or undefined when calling updateStaticVoucherCampaign.');
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
// verify required parameter 'staticVoucherCampaignUpdate' is not null or undefined
|
|
1358
|
-
if (staticVoucherCampaignUpdate === null || staticVoucherCampaignUpdate === undefined) {
|
|
1359
|
-
throw new Error('Required parameter staticVoucherCampaignUpdate was null or undefined when calling updateStaticVoucherCampaign.');
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1363
|
-
|
|
1364
|
-
let localVarUseFormData = false;
|
|
1365
|
-
|
|
1366
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
1367
|
-
method: 'PUT',
|
|
1368
|
-
qs: localVarQueryParameters,
|
|
1369
|
-
headers: localVarHeaderParams,
|
|
1370
|
-
uri: localVarPath,
|
|
1371
|
-
useQuerystring: this._useQuerystring,
|
|
1372
|
-
json: true,
|
|
1373
|
-
body: ObjectSerializer.serialize(staticVoucherCampaignUpdate, "StaticVoucherCampaignUpdate")
|
|
1374
|
-
};
|
|
1375
|
-
|
|
1376
|
-
let authenticationPromise = Promise.resolve();
|
|
1377
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1378
|
-
|
|
1379
|
-
let interceptorPromise = authenticationPromise;
|
|
1380
|
-
for (const interceptor of this.interceptors) {
|
|
1381
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
return interceptorPromise.then(() => {
|
|
1385
|
-
if (Object.keys(localVarFormParams).length) {
|
|
1386
|
-
if (localVarUseFormData) {
|
|
1387
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1388
|
-
} else {
|
|
1389
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
1390
|
-
}
|
|
1391
|
-
}
|
|
1392
|
-
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
1393
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1394
|
-
if (error) {
|
|
1395
|
-
reject(error);
|
|
1396
|
-
} else {
|
|
1397
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1398
|
-
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
1399
|
-
resolve({ response: response, body: body });
|
|
1400
|
-
} else {
|
|
1401
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
});
|
|
1405
|
-
});
|
|
1406
|
-
});
|
|
1407
|
-
}
|
|
1408
|
-
/**
|
|
1409
|
-
*
|
|
1410
|
-
* @summary Update static voucher campaign with voucher
|
|
1411
|
-
* @param campaignID
|
|
1412
|
-
* @param updateStaticVoucherCampaignWithVoucher
|
|
1413
|
-
*/
|
|
1414
|
-
public async updateStaticVoucherCampaignWithVoucher (campaignID: any, updateStaticVoucherCampaignWithVoucher: UpdateStaticVoucherCampaignWithVoucher, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
1415
|
-
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/voucher/{campaignID}'
|
|
1416
|
-
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1417
|
-
let localVarQueryParameters: any = {};
|
|
1418
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1419
|
-
const produces = ['application/json'];
|
|
1420
|
-
// give precedence to 'application/json'
|
|
1421
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
1422
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
1423
|
-
} else {
|
|
1424
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
1425
|
-
}
|
|
1426
|
-
let localVarFormParams: any = {};
|
|
1427
|
-
|
|
1428
|
-
// verify required parameter 'campaignID' is not null or undefined
|
|
1429
|
-
if (campaignID === null || campaignID === undefined) {
|
|
1430
|
-
throw new Error('Required parameter campaignID was null or undefined when calling updateStaticVoucherCampaignWithVoucher.');
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1433
|
-
// verify required parameter 'updateStaticVoucherCampaignWithVoucher' is not null or undefined
|
|
1434
|
-
if (updateStaticVoucherCampaignWithVoucher === null || updateStaticVoucherCampaignWithVoucher === undefined) {
|
|
1435
|
-
throw new Error('Required parameter updateStaticVoucherCampaignWithVoucher was null or undefined when calling updateStaticVoucherCampaignWithVoucher.');
|
|
1436
|
-
}
|
|
1437
|
-
|
|
1438
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1439
|
-
|
|
1440
|
-
let localVarUseFormData = false;
|
|
1441
|
-
|
|
1442
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
1443
|
-
method: 'PUT',
|
|
1444
|
-
qs: localVarQueryParameters,
|
|
1445
|
-
headers: localVarHeaderParams,
|
|
1446
|
-
uri: localVarPath,
|
|
1447
|
-
useQuerystring: this._useQuerystring,
|
|
1448
|
-
json: true,
|
|
1449
|
-
body: ObjectSerializer.serialize(updateStaticVoucherCampaignWithVoucher, "UpdateStaticVoucherCampaignWithVoucher")
|
|
1450
|
-
};
|
|
1451
|
-
|
|
1452
|
-
let authenticationPromise = Promise.resolve();
|
|
1453
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1454
|
-
|
|
1455
|
-
let interceptorPromise = authenticationPromise;
|
|
1456
|
-
for (const interceptor of this.interceptors) {
|
|
1457
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
return interceptorPromise.then(() => {
|
|
1461
|
-
if (Object.keys(localVarFormParams).length) {
|
|
1462
|
-
if (localVarUseFormData) {
|
|
1463
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1464
|
-
} else {
|
|
1465
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
1466
|
-
}
|
|
1467
|
-
}
|
|
1468
|
-
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
1469
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1470
|
-
if (error) {
|
|
1471
|
-
reject(error);
|
|
1472
|
-
} else {
|
|
1473
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1474
|
-
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
1475
|
-
resolve({ response: response, body: body });
|
|
1476
|
-
} else {
|
|
1477
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
1478
|
-
}
|
|
1479
|
-
}
|
|
1480
|
-
});
|
|
1481
|
-
});
|
|
1482
|
-
});
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
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 { CreateStaticVoucherCampaign } from '../model/createStaticVoucherCampaign';
|
|
20
|
+
import { CreateStaticVoucherCampaignWithVoucher } from '../model/createStaticVoucherCampaignWithVoucher';
|
|
21
|
+
import { CreateStaticVoucherCampaignWithVoucherWithCSV } from '../model/createStaticVoucherCampaignWithVoucherWithCSV';
|
|
22
|
+
import { FalsumError } from '../model/falsumError';
|
|
23
|
+
import { InlineObject24 } from '../model/inlineObject24';
|
|
24
|
+
import { InlineObject25 } from '../model/inlineObject25';
|
|
25
|
+
import { InlineResponse2003 } from '../model/inlineResponse2003';
|
|
26
|
+
import { InlineResponse2005 } from '../model/inlineResponse2005';
|
|
27
|
+
import { InternalServerError } from '../model/internalServerError';
|
|
28
|
+
import { ReachPerformanceStats } from '../model/reachPerformanceStats';
|
|
29
|
+
import { StaticVoucherCampaignUpdate } from '../model/staticVoucherCampaignUpdate';
|
|
30
|
+
import { UpdateStaticVoucherCampaignWithVoucher } from '../model/updateStaticVoucherCampaignWithVoucher';
|
|
31
|
+
import { VSCampaignGeneratedMessage } from '../model/vSCampaignGeneratedMessage';
|
|
32
|
+
import { VSCampaignGeneratedMessagePagination } from '../model/vSCampaignGeneratedMessagePagination';
|
|
33
|
+
import { WTStaticVoucher } from '../model/wTStaticVoucher';
|
|
34
|
+
import { WTStaticVoucherCampaign } from '../model/wTStaticVoucherCampaign';
|
|
35
|
+
import { WTWalletPageView } from '../model/wTWalletPageView';
|
|
36
|
+
|
|
37
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
38
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
39
|
+
|
|
40
|
+
import { HttpError, RequestFile } from './apis';
|
|
41
|
+
|
|
42
|
+
let defaultBasePath = 'https://api.wall.et';
|
|
43
|
+
|
|
44
|
+
// ===============================================
|
|
45
|
+
// This file is autogenerated - Please do not edit
|
|
46
|
+
// ===============================================
|
|
47
|
+
|
|
48
|
+
export enum StaticVoucherCampaignsApiApiKeys {
|
|
49
|
+
api_key,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export class StaticVoucherCampaignsApi {
|
|
53
|
+
protected _basePath = defaultBasePath;
|
|
54
|
+
protected _defaultHeaders : any = {};
|
|
55
|
+
protected _useQuerystring : boolean = false;
|
|
56
|
+
|
|
57
|
+
protected authentications = {
|
|
58
|
+
'default': <Authentication>new VoidAuth(),
|
|
59
|
+
'api_key': new ApiKeyAuth('header', 'access-token'),
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
protected interceptors: Interceptor[] = [];
|
|
63
|
+
|
|
64
|
+
constructor(basePath?: string);
|
|
65
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
66
|
+
if (password) {
|
|
67
|
+
if (basePath) {
|
|
68
|
+
this.basePath = basePath;
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
if (basePathOrUsername) {
|
|
72
|
+
this.basePath = basePathOrUsername
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
set useQuerystring(value: boolean) {
|
|
78
|
+
this._useQuerystring = value;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
set basePath(basePath: string) {
|
|
82
|
+
this._basePath = basePath;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
86
|
+
this._defaultHeaders = defaultHeaders;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
get defaultHeaders() {
|
|
90
|
+
return this._defaultHeaders;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
get basePath() {
|
|
94
|
+
return this._basePath;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
98
|
+
this.authentications.default = auth;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public setApiKey(key: StaticVoucherCampaignsApiApiKeys, value: string) {
|
|
102
|
+
(this.authentications as any)[StaticVoucherCampaignsApiApiKeys[key]].apiKey = value;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
106
|
+
this.interceptors.push(interceptor);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
* @summary Count loaded vouchers
|
|
112
|
+
* @param campaignID
|
|
113
|
+
*/
|
|
114
|
+
public async countVouchersLoaded (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }> {
|
|
115
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/count/vouchers/loaded/{campaignID}'
|
|
116
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
117
|
+
let localVarQueryParameters: any = {};
|
|
118
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
119
|
+
const produces = ['application/json'];
|
|
120
|
+
// give precedence to 'application/json'
|
|
121
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
122
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
123
|
+
} else {
|
|
124
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
125
|
+
}
|
|
126
|
+
let localVarFormParams: any = {};
|
|
127
|
+
|
|
128
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
129
|
+
if (campaignID === null || campaignID === undefined) {
|
|
130
|
+
throw new Error('Required parameter campaignID was null or undefined when calling countVouchersLoaded.');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
134
|
+
|
|
135
|
+
let localVarUseFormData = false;
|
|
136
|
+
|
|
137
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
138
|
+
method: 'GET',
|
|
139
|
+
qs: localVarQueryParameters,
|
|
140
|
+
headers: localVarHeaderParams,
|
|
141
|
+
uri: localVarPath,
|
|
142
|
+
useQuerystring: this._useQuerystring,
|
|
143
|
+
json: true,
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
let authenticationPromise = Promise.resolve();
|
|
147
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
148
|
+
|
|
149
|
+
let interceptorPromise = authenticationPromise;
|
|
150
|
+
for (const interceptor of this.interceptors) {
|
|
151
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return interceptorPromise.then(() => {
|
|
155
|
+
if (Object.keys(localVarFormParams).length) {
|
|
156
|
+
if (localVarUseFormData) {
|
|
157
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
158
|
+
} else {
|
|
159
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return new Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }>((resolve, reject) => {
|
|
163
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
164
|
+
if (error) {
|
|
165
|
+
reject(error);
|
|
166
|
+
} else {
|
|
167
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
168
|
+
body = ObjectSerializer.deserialize(body, "InlineResponse2003");
|
|
169
|
+
resolve({ response: response, body: body });
|
|
170
|
+
} else {
|
|
171
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
* @summary Count redeemed vouchers
|
|
181
|
+
* @param campaignID
|
|
182
|
+
*/
|
|
183
|
+
public async countVouchersRedeemed (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }> {
|
|
184
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/count/vouchers/redeemed/{campaignID}'
|
|
185
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
186
|
+
let localVarQueryParameters: any = {};
|
|
187
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
188
|
+
const produces = ['application/json'];
|
|
189
|
+
// give precedence to 'application/json'
|
|
190
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
191
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
192
|
+
} else {
|
|
193
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
194
|
+
}
|
|
195
|
+
let localVarFormParams: any = {};
|
|
196
|
+
|
|
197
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
198
|
+
if (campaignID === null || campaignID === undefined) {
|
|
199
|
+
throw new Error('Required parameter campaignID was null or undefined when calling countVouchersRedeemed.');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
203
|
+
|
|
204
|
+
let localVarUseFormData = false;
|
|
205
|
+
|
|
206
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
207
|
+
method: 'GET',
|
|
208
|
+
qs: localVarQueryParameters,
|
|
209
|
+
headers: localVarHeaderParams,
|
|
210
|
+
uri: localVarPath,
|
|
211
|
+
useQuerystring: this._useQuerystring,
|
|
212
|
+
json: true,
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
let authenticationPromise = Promise.resolve();
|
|
216
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
217
|
+
|
|
218
|
+
let interceptorPromise = authenticationPromise;
|
|
219
|
+
for (const interceptor of this.interceptors) {
|
|
220
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return interceptorPromise.then(() => {
|
|
224
|
+
if (Object.keys(localVarFormParams).length) {
|
|
225
|
+
if (localVarUseFormData) {
|
|
226
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
227
|
+
} else {
|
|
228
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return new Promise<{ response: http.IncomingMessage; body: InlineResponse2003; }>((resolve, reject) => {
|
|
232
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
233
|
+
if (error) {
|
|
234
|
+
reject(error);
|
|
235
|
+
} else {
|
|
236
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
237
|
+
body = ObjectSerializer.deserialize(body, "InlineResponse2003");
|
|
238
|
+
resolve({ response: response, body: body });
|
|
239
|
+
} else {
|
|
240
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
*
|
|
249
|
+
* @summary Create static voucher campaign
|
|
250
|
+
* @param createStaticVoucherCampaign
|
|
251
|
+
*/
|
|
252
|
+
public async createStaticVoucherCampaign (createStaticVoucherCampaign: CreateStaticVoucherCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
253
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign';
|
|
254
|
+
let localVarQueryParameters: any = {};
|
|
255
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
256
|
+
const produces = ['application/json'];
|
|
257
|
+
// give precedence to 'application/json'
|
|
258
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
259
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
260
|
+
} else {
|
|
261
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
262
|
+
}
|
|
263
|
+
let localVarFormParams: any = {};
|
|
264
|
+
|
|
265
|
+
// verify required parameter 'createStaticVoucherCampaign' is not null or undefined
|
|
266
|
+
if (createStaticVoucherCampaign === null || createStaticVoucherCampaign === undefined) {
|
|
267
|
+
throw new Error('Required parameter createStaticVoucherCampaign was null or undefined when calling createStaticVoucherCampaign.');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
271
|
+
|
|
272
|
+
let localVarUseFormData = false;
|
|
273
|
+
|
|
274
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
275
|
+
method: 'POST',
|
|
276
|
+
qs: localVarQueryParameters,
|
|
277
|
+
headers: localVarHeaderParams,
|
|
278
|
+
uri: localVarPath,
|
|
279
|
+
useQuerystring: this._useQuerystring,
|
|
280
|
+
json: true,
|
|
281
|
+
body: ObjectSerializer.serialize(createStaticVoucherCampaign, "CreateStaticVoucherCampaign")
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
let authenticationPromise = Promise.resolve();
|
|
285
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
286
|
+
|
|
287
|
+
let interceptorPromise = authenticationPromise;
|
|
288
|
+
for (const interceptor of this.interceptors) {
|
|
289
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return interceptorPromise.then(() => {
|
|
293
|
+
if (Object.keys(localVarFormParams).length) {
|
|
294
|
+
if (localVarUseFormData) {
|
|
295
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
296
|
+
} else {
|
|
297
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
301
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
302
|
+
if (error) {
|
|
303
|
+
reject(error);
|
|
304
|
+
} else {
|
|
305
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
306
|
+
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
307
|
+
resolve({ response: response, body: body });
|
|
308
|
+
} else {
|
|
309
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
*
|
|
318
|
+
* @summary Import static voucher campaign
|
|
319
|
+
* @param createStaticVoucherCampaignWithVoucherWithCSV
|
|
320
|
+
*/
|
|
321
|
+
public async createStaticVoucherCampaignFromCSV (createStaticVoucherCampaignWithVoucherWithCSV: CreateStaticVoucherCampaignWithVoucherWithCSV, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
322
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/csv';
|
|
323
|
+
let localVarQueryParameters: any = {};
|
|
324
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
325
|
+
const produces = ['application/json'];
|
|
326
|
+
// give precedence to 'application/json'
|
|
327
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
328
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
329
|
+
} else {
|
|
330
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
331
|
+
}
|
|
332
|
+
let localVarFormParams: any = {};
|
|
333
|
+
|
|
334
|
+
// verify required parameter 'createStaticVoucherCampaignWithVoucherWithCSV' is not null or undefined
|
|
335
|
+
if (createStaticVoucherCampaignWithVoucherWithCSV === null || createStaticVoucherCampaignWithVoucherWithCSV === undefined) {
|
|
336
|
+
throw new Error('Required parameter createStaticVoucherCampaignWithVoucherWithCSV was null or undefined when calling createStaticVoucherCampaignFromCSV.');
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
340
|
+
|
|
341
|
+
let localVarUseFormData = false;
|
|
342
|
+
|
|
343
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
344
|
+
method: 'POST',
|
|
345
|
+
qs: localVarQueryParameters,
|
|
346
|
+
headers: localVarHeaderParams,
|
|
347
|
+
uri: localVarPath,
|
|
348
|
+
useQuerystring: this._useQuerystring,
|
|
349
|
+
json: true,
|
|
350
|
+
body: ObjectSerializer.serialize(createStaticVoucherCampaignWithVoucherWithCSV, "CreateStaticVoucherCampaignWithVoucherWithCSV")
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
let authenticationPromise = Promise.resolve();
|
|
354
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
355
|
+
|
|
356
|
+
let interceptorPromise = authenticationPromise;
|
|
357
|
+
for (const interceptor of this.interceptors) {
|
|
358
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return interceptorPromise.then(() => {
|
|
362
|
+
if (Object.keys(localVarFormParams).length) {
|
|
363
|
+
if (localVarUseFormData) {
|
|
364
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
365
|
+
} else {
|
|
366
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
370
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
371
|
+
if (error) {
|
|
372
|
+
reject(error);
|
|
373
|
+
} else {
|
|
374
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
375
|
+
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
376
|
+
resolve({ response: response, body: body });
|
|
377
|
+
} else {
|
|
378
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
*
|
|
387
|
+
* @summary Create static voucher campaign with voucher
|
|
388
|
+
* @param createStaticVoucherCampaignWithVoucher
|
|
389
|
+
*/
|
|
390
|
+
public async createStaticVoucherCampaignWithVoucher (createStaticVoucherCampaignWithVoucher: CreateStaticVoucherCampaignWithVoucher, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
391
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/voucher';
|
|
392
|
+
let localVarQueryParameters: any = {};
|
|
393
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
394
|
+
const produces = ['application/json'];
|
|
395
|
+
// give precedence to 'application/json'
|
|
396
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
397
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
398
|
+
} else {
|
|
399
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
400
|
+
}
|
|
401
|
+
let localVarFormParams: any = {};
|
|
402
|
+
|
|
403
|
+
// verify required parameter 'createStaticVoucherCampaignWithVoucher' is not null or undefined
|
|
404
|
+
if (createStaticVoucherCampaignWithVoucher === null || createStaticVoucherCampaignWithVoucher === undefined) {
|
|
405
|
+
throw new Error('Required parameter createStaticVoucherCampaignWithVoucher was null or undefined when calling createStaticVoucherCampaignWithVoucher.');
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
409
|
+
|
|
410
|
+
let localVarUseFormData = false;
|
|
411
|
+
|
|
412
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
413
|
+
method: 'POST',
|
|
414
|
+
qs: localVarQueryParameters,
|
|
415
|
+
headers: localVarHeaderParams,
|
|
416
|
+
uri: localVarPath,
|
|
417
|
+
useQuerystring: this._useQuerystring,
|
|
418
|
+
json: true,
|
|
419
|
+
body: ObjectSerializer.serialize(createStaticVoucherCampaignWithVoucher, "CreateStaticVoucherCampaignWithVoucher")
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
let authenticationPromise = Promise.resolve();
|
|
423
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
424
|
+
|
|
425
|
+
let interceptorPromise = authenticationPromise;
|
|
426
|
+
for (const interceptor of this.interceptors) {
|
|
427
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return interceptorPromise.then(() => {
|
|
431
|
+
if (Object.keys(localVarFormParams).length) {
|
|
432
|
+
if (localVarUseFormData) {
|
|
433
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
434
|
+
} else {
|
|
435
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
439
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
440
|
+
if (error) {
|
|
441
|
+
reject(error);
|
|
442
|
+
} else {
|
|
443
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
444
|
+
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
445
|
+
resolve({ response: response, body: body });
|
|
446
|
+
} else {
|
|
447
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
*
|
|
456
|
+
* @summary Duplicate static voucher campaign
|
|
457
|
+
* @param campaignID
|
|
458
|
+
*/
|
|
459
|
+
public async duplicateStaticVoucherCampaignById (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
460
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/duplicate/{campaignID}'
|
|
461
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
462
|
+
let localVarQueryParameters: any = {};
|
|
463
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
464
|
+
const produces = ['application/json'];
|
|
465
|
+
// give precedence to 'application/json'
|
|
466
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
467
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
468
|
+
} else {
|
|
469
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
470
|
+
}
|
|
471
|
+
let localVarFormParams: any = {};
|
|
472
|
+
|
|
473
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
474
|
+
if (campaignID === null || campaignID === undefined) {
|
|
475
|
+
throw new Error('Required parameter campaignID was null or undefined when calling duplicateStaticVoucherCampaignById.');
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
479
|
+
|
|
480
|
+
let localVarUseFormData = false;
|
|
481
|
+
|
|
482
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
483
|
+
method: 'POST',
|
|
484
|
+
qs: localVarQueryParameters,
|
|
485
|
+
headers: localVarHeaderParams,
|
|
486
|
+
uri: localVarPath,
|
|
487
|
+
useQuerystring: this._useQuerystring,
|
|
488
|
+
json: true,
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
let authenticationPromise = Promise.resolve();
|
|
492
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
493
|
+
|
|
494
|
+
let interceptorPromise = authenticationPromise;
|
|
495
|
+
for (const interceptor of this.interceptors) {
|
|
496
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
return interceptorPromise.then(() => {
|
|
500
|
+
if (Object.keys(localVarFormParams).length) {
|
|
501
|
+
if (localVarUseFormData) {
|
|
502
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
503
|
+
} else {
|
|
504
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
508
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
509
|
+
if (error) {
|
|
510
|
+
reject(error);
|
|
511
|
+
} else {
|
|
512
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
513
|
+
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
514
|
+
resolve({ response: response, body: body });
|
|
515
|
+
} else {
|
|
516
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
});
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
*
|
|
525
|
+
* @summary Fetch performance overview
|
|
526
|
+
* @param campaignID
|
|
527
|
+
*/
|
|
528
|
+
public async fetchPerformanceOverview (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
|
|
529
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/overview/performance/{campaignID}'
|
|
530
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
531
|
+
let localVarQueryParameters: any = {};
|
|
532
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
533
|
+
const produces = ['application/json'];
|
|
534
|
+
// give precedence to 'application/json'
|
|
535
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
536
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
537
|
+
} else {
|
|
538
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
539
|
+
}
|
|
540
|
+
let localVarFormParams: any = {};
|
|
541
|
+
|
|
542
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
543
|
+
if (campaignID === null || campaignID === undefined) {
|
|
544
|
+
throw new Error('Required parameter campaignID was null or undefined when calling fetchPerformanceOverview.');
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
548
|
+
|
|
549
|
+
let localVarUseFormData = false;
|
|
550
|
+
|
|
551
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
552
|
+
method: 'GET',
|
|
553
|
+
qs: localVarQueryParameters,
|
|
554
|
+
headers: localVarHeaderParams,
|
|
555
|
+
uri: localVarPath,
|
|
556
|
+
useQuerystring: this._useQuerystring,
|
|
557
|
+
json: true,
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
let authenticationPromise = Promise.resolve();
|
|
561
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
562
|
+
|
|
563
|
+
let interceptorPromise = authenticationPromise;
|
|
564
|
+
for (const interceptor of this.interceptors) {
|
|
565
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
return interceptorPromise.then(() => {
|
|
569
|
+
if (Object.keys(localVarFormParams).length) {
|
|
570
|
+
if (localVarUseFormData) {
|
|
571
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
572
|
+
} else {
|
|
573
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
return new Promise<{ response: http.IncomingMessage; body: object; }>((resolve, reject) => {
|
|
577
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
578
|
+
if (error) {
|
|
579
|
+
reject(error);
|
|
580
|
+
} else {
|
|
581
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
582
|
+
body = ObjectSerializer.deserialize(body, "object");
|
|
583
|
+
resolve({ response: response, body: body });
|
|
584
|
+
} else {
|
|
585
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
});
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
*
|
|
594
|
+
* @summary Get the reach statistics of all the static voucher campaigns
|
|
595
|
+
* @param broadcastScheduledStartAt
|
|
596
|
+
* @param broadcastScheduledEndAt
|
|
597
|
+
*/
|
|
598
|
+
public async fetchReachStatsOfAllStaticVoucherCampaigns (broadcastScheduledStartAt?: Date, broadcastScheduledEndAt?: Date, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }> {
|
|
599
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/reach/all';
|
|
600
|
+
let localVarQueryParameters: any = {};
|
|
601
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
602
|
+
const produces = ['application/json'];
|
|
603
|
+
// give precedence to 'application/json'
|
|
604
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
605
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
606
|
+
} else {
|
|
607
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
608
|
+
}
|
|
609
|
+
let localVarFormParams: any = {};
|
|
610
|
+
|
|
611
|
+
if (broadcastScheduledStartAt !== undefined) {
|
|
612
|
+
localVarQueryParameters['broadcastScheduledStartAt'] = ObjectSerializer.serialize(broadcastScheduledStartAt, "Date");
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
if (broadcastScheduledEndAt !== undefined) {
|
|
616
|
+
localVarQueryParameters['broadcastScheduledEndAt'] = ObjectSerializer.serialize(broadcastScheduledEndAt, "Date");
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
620
|
+
|
|
621
|
+
let localVarUseFormData = false;
|
|
622
|
+
|
|
623
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
624
|
+
method: 'GET',
|
|
625
|
+
qs: localVarQueryParameters,
|
|
626
|
+
headers: localVarHeaderParams,
|
|
627
|
+
uri: localVarPath,
|
|
628
|
+
useQuerystring: this._useQuerystring,
|
|
629
|
+
json: true,
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
let authenticationPromise = Promise.resolve();
|
|
633
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
634
|
+
|
|
635
|
+
let interceptorPromise = authenticationPromise;
|
|
636
|
+
for (const interceptor of this.interceptors) {
|
|
637
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
return interceptorPromise.then(() => {
|
|
641
|
+
if (Object.keys(localVarFormParams).length) {
|
|
642
|
+
if (localVarUseFormData) {
|
|
643
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
644
|
+
} else {
|
|
645
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
return new Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }>((resolve, reject) => {
|
|
649
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
650
|
+
if (error) {
|
|
651
|
+
reject(error);
|
|
652
|
+
} else {
|
|
653
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
654
|
+
body = ObjectSerializer.deserialize(body, "ReachPerformanceStats");
|
|
655
|
+
resolve({ response: response, body: body });
|
|
656
|
+
} else {
|
|
657
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
});
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
*
|
|
666
|
+
* @summary Get the reach statistics of an individual static voucher campaign
|
|
667
|
+
* @param staticVoucherCampaignID
|
|
668
|
+
* @param broadcastScheduledStartAt
|
|
669
|
+
* @param broadcastScheduledEndAt
|
|
670
|
+
*/
|
|
671
|
+
public async fetchReachStatsOfIndividualStaticVoucherCampaign (staticVoucherCampaignID: any, broadcastScheduledStartAt?: Date, broadcastScheduledEndAt?: Date, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }> {
|
|
672
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/reach/{staticVoucherCampaignID}'
|
|
673
|
+
.replace('{' + 'staticVoucherCampaignID' + '}', encodeURIComponent(String(staticVoucherCampaignID)));
|
|
674
|
+
let localVarQueryParameters: any = {};
|
|
675
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
676
|
+
const produces = ['application/json'];
|
|
677
|
+
// give precedence to 'application/json'
|
|
678
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
679
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
680
|
+
} else {
|
|
681
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
682
|
+
}
|
|
683
|
+
let localVarFormParams: any = {};
|
|
684
|
+
|
|
685
|
+
// verify required parameter 'staticVoucherCampaignID' is not null or undefined
|
|
686
|
+
if (staticVoucherCampaignID === null || staticVoucherCampaignID === undefined) {
|
|
687
|
+
throw new Error('Required parameter staticVoucherCampaignID was null or undefined when calling fetchReachStatsOfIndividualStaticVoucherCampaign.');
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
if (broadcastScheduledStartAt !== undefined) {
|
|
691
|
+
localVarQueryParameters['broadcastScheduledStartAt'] = ObjectSerializer.serialize(broadcastScheduledStartAt, "Date");
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
if (broadcastScheduledEndAt !== undefined) {
|
|
695
|
+
localVarQueryParameters['broadcastScheduledEndAt'] = ObjectSerializer.serialize(broadcastScheduledEndAt, "Date");
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
699
|
+
|
|
700
|
+
let localVarUseFormData = false;
|
|
701
|
+
|
|
702
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
703
|
+
method: 'GET',
|
|
704
|
+
qs: localVarQueryParameters,
|
|
705
|
+
headers: localVarHeaderParams,
|
|
706
|
+
uri: localVarPath,
|
|
707
|
+
useQuerystring: this._useQuerystring,
|
|
708
|
+
json: true,
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
let authenticationPromise = Promise.resolve();
|
|
712
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
713
|
+
|
|
714
|
+
let interceptorPromise = authenticationPromise;
|
|
715
|
+
for (const interceptor of this.interceptors) {
|
|
716
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
return interceptorPromise.then(() => {
|
|
720
|
+
if (Object.keys(localVarFormParams).length) {
|
|
721
|
+
if (localVarUseFormData) {
|
|
722
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
723
|
+
} else {
|
|
724
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return new Promise<{ response: http.IncomingMessage; body: ReachPerformanceStats; }>((resolve, reject) => {
|
|
728
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
729
|
+
if (error) {
|
|
730
|
+
reject(error);
|
|
731
|
+
} else {
|
|
732
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
733
|
+
body = ObjectSerializer.deserialize(body, "ReachPerformanceStats");
|
|
734
|
+
resolve({ response: response, body: body });
|
|
735
|
+
} else {
|
|
736
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
});
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
*
|
|
745
|
+
* @summary Fetch static voucher campaign
|
|
746
|
+
* @param id
|
|
747
|
+
*/
|
|
748
|
+
public async fetchStaticVoucherCampaignById (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
749
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/{id}'
|
|
750
|
+
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
751
|
+
let localVarQueryParameters: any = {};
|
|
752
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
753
|
+
const produces = ['application/json'];
|
|
754
|
+
// give precedence to 'application/json'
|
|
755
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
756
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
757
|
+
} else {
|
|
758
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
759
|
+
}
|
|
760
|
+
let localVarFormParams: any = {};
|
|
761
|
+
|
|
762
|
+
// verify required parameter 'id' is not null or undefined
|
|
763
|
+
if (id === null || id === undefined) {
|
|
764
|
+
throw new Error('Required parameter id was null or undefined when calling fetchStaticVoucherCampaignById.');
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
768
|
+
|
|
769
|
+
let localVarUseFormData = false;
|
|
770
|
+
|
|
771
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
772
|
+
method: 'GET',
|
|
773
|
+
qs: localVarQueryParameters,
|
|
774
|
+
headers: localVarHeaderParams,
|
|
775
|
+
uri: localVarPath,
|
|
776
|
+
useQuerystring: this._useQuerystring,
|
|
777
|
+
json: true,
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
let authenticationPromise = Promise.resolve();
|
|
781
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
782
|
+
|
|
783
|
+
let interceptorPromise = authenticationPromise;
|
|
784
|
+
for (const interceptor of this.interceptors) {
|
|
785
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
return interceptorPromise.then(() => {
|
|
789
|
+
if (Object.keys(localVarFormParams).length) {
|
|
790
|
+
if (localVarUseFormData) {
|
|
791
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
792
|
+
} else {
|
|
793
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
797
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
798
|
+
if (error) {
|
|
799
|
+
reject(error);
|
|
800
|
+
} else {
|
|
801
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
802
|
+
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
803
|
+
resolve({ response: response, body: body });
|
|
804
|
+
} else {
|
|
805
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
});
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
/**
|
|
813
|
+
*
|
|
814
|
+
* @summary Fetches all static vouchers campaigns
|
|
815
|
+
* @param isArchiveIncluded
|
|
816
|
+
* @param sourceID
|
|
817
|
+
*/
|
|
818
|
+
public async fetchStaticVoucherCampaigns (isArchiveIncluded?: boolean, sourceID?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucherCampaign>; }> {
|
|
819
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/all';
|
|
820
|
+
let localVarQueryParameters: any = {};
|
|
821
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
822
|
+
const produces = ['application/json'];
|
|
823
|
+
// give precedence to 'application/json'
|
|
824
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
825
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
826
|
+
} else {
|
|
827
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
828
|
+
}
|
|
829
|
+
let localVarFormParams: any = {};
|
|
830
|
+
|
|
831
|
+
if (isArchiveIncluded !== undefined) {
|
|
832
|
+
localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
if (sourceID !== undefined) {
|
|
836
|
+
localVarQueryParameters['sourceID'] = ObjectSerializer.serialize(sourceID, "number");
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
840
|
+
|
|
841
|
+
let localVarUseFormData = false;
|
|
842
|
+
|
|
843
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
844
|
+
method: 'GET',
|
|
845
|
+
qs: localVarQueryParameters,
|
|
846
|
+
headers: localVarHeaderParams,
|
|
847
|
+
uri: localVarPath,
|
|
848
|
+
useQuerystring: this._useQuerystring,
|
|
849
|
+
json: true,
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
let authenticationPromise = Promise.resolve();
|
|
853
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
854
|
+
|
|
855
|
+
let interceptorPromise = authenticationPromise;
|
|
856
|
+
for (const interceptor of this.interceptors) {
|
|
857
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
return interceptorPromise.then(() => {
|
|
861
|
+
if (Object.keys(localVarFormParams).length) {
|
|
862
|
+
if (localVarUseFormData) {
|
|
863
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
864
|
+
} else {
|
|
865
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucherCampaign>; }>((resolve, reject) => {
|
|
869
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
870
|
+
if (error) {
|
|
871
|
+
reject(error);
|
|
872
|
+
} else {
|
|
873
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
874
|
+
body = ObjectSerializer.deserialize(body, "Array<WTStaticVoucherCampaign>");
|
|
875
|
+
resolve({ response: response, body: body });
|
|
876
|
+
} else {
|
|
877
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
});
|
|
881
|
+
});
|
|
882
|
+
});
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
*
|
|
886
|
+
* @summary Fetch static vouchers
|
|
887
|
+
* @param campaignID
|
|
888
|
+
*/
|
|
889
|
+
public async fetchStaticVouchers (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucher>; }> {
|
|
890
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/staticVouchers/{campaignID}'
|
|
891
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
892
|
+
let localVarQueryParameters: any = {};
|
|
893
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
894
|
+
const produces = ['application/json'];
|
|
895
|
+
// give precedence to 'application/json'
|
|
896
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
897
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
898
|
+
} else {
|
|
899
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
900
|
+
}
|
|
901
|
+
let localVarFormParams: any = {};
|
|
902
|
+
|
|
903
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
904
|
+
if (campaignID === null || campaignID === undefined) {
|
|
905
|
+
throw new Error('Required parameter campaignID was null or undefined when calling fetchStaticVouchers.');
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
909
|
+
|
|
910
|
+
let localVarUseFormData = false;
|
|
911
|
+
|
|
912
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
913
|
+
method: 'GET',
|
|
914
|
+
qs: localVarQueryParameters,
|
|
915
|
+
headers: localVarHeaderParams,
|
|
916
|
+
uri: localVarPath,
|
|
917
|
+
useQuerystring: this._useQuerystring,
|
|
918
|
+
json: true,
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
let authenticationPromise = Promise.resolve();
|
|
922
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
923
|
+
|
|
924
|
+
let interceptorPromise = authenticationPromise;
|
|
925
|
+
for (const interceptor of this.interceptors) {
|
|
926
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
return interceptorPromise.then(() => {
|
|
930
|
+
if (Object.keys(localVarFormParams).length) {
|
|
931
|
+
if (localVarUseFormData) {
|
|
932
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
933
|
+
} else {
|
|
934
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucher>; }>((resolve, reject) => {
|
|
938
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
939
|
+
if (error) {
|
|
940
|
+
reject(error);
|
|
941
|
+
} else {
|
|
942
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
943
|
+
body = ObjectSerializer.deserialize(body, "Array<WTStaticVoucher>");
|
|
944
|
+
resolve({ response: response, body: body });
|
|
945
|
+
} else {
|
|
946
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
});
|
|
950
|
+
});
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
*
|
|
955
|
+
* @summary Fetch static vouchers by page
|
|
956
|
+
* @param campaignID
|
|
957
|
+
* @param pagenum
|
|
958
|
+
* @param pagesize
|
|
959
|
+
*/
|
|
960
|
+
public async fetchStaticVouchersPage (campaignID: any, pagenum: number, pagesize: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InlineResponse2005; }> {
|
|
961
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/staticVouchers/page/{campaignID}'
|
|
962
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
963
|
+
let localVarQueryParameters: any = {};
|
|
964
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
965
|
+
const produces = ['application/json'];
|
|
966
|
+
// give precedence to 'application/json'
|
|
967
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
968
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
969
|
+
} else {
|
|
970
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
971
|
+
}
|
|
972
|
+
let localVarFormParams: any = {};
|
|
973
|
+
|
|
974
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
975
|
+
if (campaignID === null || campaignID === undefined) {
|
|
976
|
+
throw new Error('Required parameter campaignID was null or undefined when calling fetchStaticVouchersPage.');
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
// verify required parameter 'pagenum' is not null or undefined
|
|
980
|
+
if (pagenum === null || pagenum === undefined) {
|
|
981
|
+
throw new Error('Required parameter pagenum was null or undefined when calling fetchStaticVouchersPage.');
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
// verify required parameter 'pagesize' is not null or undefined
|
|
985
|
+
if (pagesize === null || pagesize === undefined) {
|
|
986
|
+
throw new Error('Required parameter pagesize was null or undefined when calling fetchStaticVouchersPage.');
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
if (pagenum !== undefined) {
|
|
990
|
+
localVarQueryParameters['pagenum'] = ObjectSerializer.serialize(pagenum, "number");
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
if (pagesize !== undefined) {
|
|
994
|
+
localVarQueryParameters['pagesize'] = ObjectSerializer.serialize(pagesize, "number");
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
998
|
+
|
|
999
|
+
let localVarUseFormData = false;
|
|
1000
|
+
|
|
1001
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1002
|
+
method: 'GET',
|
|
1003
|
+
qs: localVarQueryParameters,
|
|
1004
|
+
headers: localVarHeaderParams,
|
|
1005
|
+
uri: localVarPath,
|
|
1006
|
+
useQuerystring: this._useQuerystring,
|
|
1007
|
+
json: true,
|
|
1008
|
+
};
|
|
1009
|
+
|
|
1010
|
+
let authenticationPromise = Promise.resolve();
|
|
1011
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1012
|
+
|
|
1013
|
+
let interceptorPromise = authenticationPromise;
|
|
1014
|
+
for (const interceptor of this.interceptors) {
|
|
1015
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
return interceptorPromise.then(() => {
|
|
1019
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1020
|
+
if (localVarUseFormData) {
|
|
1021
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1022
|
+
} else {
|
|
1023
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
return new Promise<{ response: http.IncomingMessage; body: InlineResponse2005; }>((resolve, reject) => {
|
|
1027
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1028
|
+
if (error) {
|
|
1029
|
+
reject(error);
|
|
1030
|
+
} else {
|
|
1031
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1032
|
+
body = ObjectSerializer.deserialize(body, "InlineResponse2005");
|
|
1033
|
+
resolve({ response: response, body: body });
|
|
1034
|
+
} else {
|
|
1035
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
});
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
*
|
|
1044
|
+
* @summary Fetch views
|
|
1045
|
+
* @param campaignID
|
|
1046
|
+
*/
|
|
1047
|
+
public async fetchViews (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTWalletPageView>; }> {
|
|
1048
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/views/{campaignID}'
|
|
1049
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1050
|
+
let localVarQueryParameters: any = {};
|
|
1051
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1052
|
+
const produces = ['application/json'];
|
|
1053
|
+
// give precedence to 'application/json'
|
|
1054
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1055
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1056
|
+
} else {
|
|
1057
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1058
|
+
}
|
|
1059
|
+
let localVarFormParams: any = {};
|
|
1060
|
+
|
|
1061
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
1062
|
+
if (campaignID === null || campaignID === undefined) {
|
|
1063
|
+
throw new Error('Required parameter campaignID was null or undefined when calling fetchViews.');
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1067
|
+
|
|
1068
|
+
let localVarUseFormData = false;
|
|
1069
|
+
|
|
1070
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1071
|
+
method: 'GET',
|
|
1072
|
+
qs: localVarQueryParameters,
|
|
1073
|
+
headers: localVarHeaderParams,
|
|
1074
|
+
uri: localVarPath,
|
|
1075
|
+
useQuerystring: this._useQuerystring,
|
|
1076
|
+
json: true,
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
let authenticationPromise = Promise.resolve();
|
|
1080
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1081
|
+
|
|
1082
|
+
let interceptorPromise = authenticationPromise;
|
|
1083
|
+
for (const interceptor of this.interceptors) {
|
|
1084
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
return interceptorPromise.then(() => {
|
|
1088
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1089
|
+
if (localVarUseFormData) {
|
|
1090
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1091
|
+
} else {
|
|
1092
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<WTWalletPageView>; }>((resolve, reject) => {
|
|
1096
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1097
|
+
if (error) {
|
|
1098
|
+
reject(error);
|
|
1099
|
+
} else {
|
|
1100
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1101
|
+
body = ObjectSerializer.deserialize(body, "Array<WTWalletPageView>");
|
|
1102
|
+
resolve({ response: response, body: body });
|
|
1103
|
+
} else {
|
|
1104
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
});
|
|
1108
|
+
});
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
*
|
|
1113
|
+
* @summary Fetch redeemed vouchers
|
|
1114
|
+
* @param campaignID
|
|
1115
|
+
*/
|
|
1116
|
+
public async fetchVouchersRedeemed (campaignID: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucher>; }> {
|
|
1117
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/vouchers/redeemed/{campaignID}'
|
|
1118
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1119
|
+
let localVarQueryParameters: any = {};
|
|
1120
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1121
|
+
const produces = ['application/json'];
|
|
1122
|
+
// give precedence to 'application/json'
|
|
1123
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1124
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1125
|
+
} else {
|
|
1126
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1127
|
+
}
|
|
1128
|
+
let localVarFormParams: any = {};
|
|
1129
|
+
|
|
1130
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
1131
|
+
if (campaignID === null || campaignID === undefined) {
|
|
1132
|
+
throw new Error('Required parameter campaignID was null or undefined when calling fetchVouchersRedeemed.');
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1136
|
+
|
|
1137
|
+
let localVarUseFormData = false;
|
|
1138
|
+
|
|
1139
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1140
|
+
method: 'GET',
|
|
1141
|
+
qs: localVarQueryParameters,
|
|
1142
|
+
headers: localVarHeaderParams,
|
|
1143
|
+
uri: localVarPath,
|
|
1144
|
+
useQuerystring: this._useQuerystring,
|
|
1145
|
+
json: true,
|
|
1146
|
+
};
|
|
1147
|
+
|
|
1148
|
+
let authenticationPromise = Promise.resolve();
|
|
1149
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1150
|
+
|
|
1151
|
+
let interceptorPromise = authenticationPromise;
|
|
1152
|
+
for (const interceptor of this.interceptors) {
|
|
1153
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
return interceptorPromise.then(() => {
|
|
1157
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1158
|
+
if (localVarUseFormData) {
|
|
1159
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1160
|
+
} else {
|
|
1161
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<WTStaticVoucher>; }>((resolve, reject) => {
|
|
1165
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1166
|
+
if (error) {
|
|
1167
|
+
reject(error);
|
|
1168
|
+
} else {
|
|
1169
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1170
|
+
body = ObjectSerializer.deserialize(body, "Array<WTStaticVoucher>");
|
|
1171
|
+
resolve({ response: response, body: body });
|
|
1172
|
+
} else {
|
|
1173
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
});
|
|
1177
|
+
});
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
/**
|
|
1181
|
+
*
|
|
1182
|
+
* @summary Preview static vouchers. This method has been deprecated. Please use /preview/page/{campaignID} for better performance.
|
|
1183
|
+
* @param campaignID
|
|
1184
|
+
* @param inlineObject24
|
|
1185
|
+
*/
|
|
1186
|
+
public async previewMessages (campaignID: any, inlineObject24: InlineObject24, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<VSCampaignGeneratedMessage>; }> {
|
|
1187
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/preview/{campaignID}'
|
|
1188
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1189
|
+
let localVarQueryParameters: any = {};
|
|
1190
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1191
|
+
const produces = ['application/json'];
|
|
1192
|
+
// give precedence to 'application/json'
|
|
1193
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1194
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1195
|
+
} else {
|
|
1196
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1197
|
+
}
|
|
1198
|
+
let localVarFormParams: any = {};
|
|
1199
|
+
|
|
1200
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
1201
|
+
if (campaignID === null || campaignID === undefined) {
|
|
1202
|
+
throw new Error('Required parameter campaignID was null or undefined when calling previewMessages.');
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
// verify required parameter 'inlineObject24' is not null or undefined
|
|
1206
|
+
if (inlineObject24 === null || inlineObject24 === undefined) {
|
|
1207
|
+
throw new Error('Required parameter inlineObject24 was null or undefined when calling previewMessages.');
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1211
|
+
|
|
1212
|
+
let localVarUseFormData = false;
|
|
1213
|
+
|
|
1214
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1215
|
+
method: 'PUT',
|
|
1216
|
+
qs: localVarQueryParameters,
|
|
1217
|
+
headers: localVarHeaderParams,
|
|
1218
|
+
uri: localVarPath,
|
|
1219
|
+
useQuerystring: this._useQuerystring,
|
|
1220
|
+
json: true,
|
|
1221
|
+
body: ObjectSerializer.serialize(inlineObject24, "InlineObject24")
|
|
1222
|
+
};
|
|
1223
|
+
|
|
1224
|
+
let authenticationPromise = Promise.resolve();
|
|
1225
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1226
|
+
|
|
1227
|
+
let interceptorPromise = authenticationPromise;
|
|
1228
|
+
for (const interceptor of this.interceptors) {
|
|
1229
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
return interceptorPromise.then(() => {
|
|
1233
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1234
|
+
if (localVarUseFormData) {
|
|
1235
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1236
|
+
} else {
|
|
1237
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
return new Promise<{ response: http.IncomingMessage; body: Array<VSCampaignGeneratedMessage>; }>((resolve, reject) => {
|
|
1241
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1242
|
+
if (error) {
|
|
1243
|
+
reject(error);
|
|
1244
|
+
} else {
|
|
1245
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1246
|
+
body = ObjectSerializer.deserialize(body, "Array<VSCampaignGeneratedMessage>");
|
|
1247
|
+
resolve({ response: response, body: body });
|
|
1248
|
+
} else {
|
|
1249
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
});
|
|
1253
|
+
});
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
*
|
|
1258
|
+
* @summary Preview static vouchers by page
|
|
1259
|
+
* @param campaignID
|
|
1260
|
+
* @param inlineObject25
|
|
1261
|
+
*/
|
|
1262
|
+
public async previewMessagesByPage (campaignID: any, inlineObject25: InlineObject25, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: VSCampaignGeneratedMessagePagination; }> {
|
|
1263
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/preview/page/{campaignID}'
|
|
1264
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1265
|
+
let localVarQueryParameters: any = {};
|
|
1266
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1267
|
+
const produces = ['application/json'];
|
|
1268
|
+
// give precedence to 'application/json'
|
|
1269
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1270
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1271
|
+
} else {
|
|
1272
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1273
|
+
}
|
|
1274
|
+
let localVarFormParams: any = {};
|
|
1275
|
+
|
|
1276
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
1277
|
+
if (campaignID === null || campaignID === undefined) {
|
|
1278
|
+
throw new Error('Required parameter campaignID was null or undefined when calling previewMessagesByPage.');
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
// verify required parameter 'inlineObject25' is not null or undefined
|
|
1282
|
+
if (inlineObject25 === null || inlineObject25 === undefined) {
|
|
1283
|
+
throw new Error('Required parameter inlineObject25 was null or undefined when calling previewMessagesByPage.');
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1287
|
+
|
|
1288
|
+
let localVarUseFormData = false;
|
|
1289
|
+
|
|
1290
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1291
|
+
method: 'PUT',
|
|
1292
|
+
qs: localVarQueryParameters,
|
|
1293
|
+
headers: localVarHeaderParams,
|
|
1294
|
+
uri: localVarPath,
|
|
1295
|
+
useQuerystring: this._useQuerystring,
|
|
1296
|
+
json: true,
|
|
1297
|
+
body: ObjectSerializer.serialize(inlineObject25, "InlineObject25")
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
let authenticationPromise = Promise.resolve();
|
|
1301
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1302
|
+
|
|
1303
|
+
let interceptorPromise = authenticationPromise;
|
|
1304
|
+
for (const interceptor of this.interceptors) {
|
|
1305
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
return interceptorPromise.then(() => {
|
|
1309
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1310
|
+
if (localVarUseFormData) {
|
|
1311
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1312
|
+
} else {
|
|
1313
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
return new Promise<{ response: http.IncomingMessage; body: VSCampaignGeneratedMessagePagination; }>((resolve, reject) => {
|
|
1317
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1318
|
+
if (error) {
|
|
1319
|
+
reject(error);
|
|
1320
|
+
} else {
|
|
1321
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1322
|
+
body = ObjectSerializer.deserialize(body, "VSCampaignGeneratedMessagePagination");
|
|
1323
|
+
resolve({ response: response, body: body });
|
|
1324
|
+
} else {
|
|
1325
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
});
|
|
1329
|
+
});
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
*
|
|
1334
|
+
* @summary Update static voucher campaign
|
|
1335
|
+
* @param campaignID
|
|
1336
|
+
* @param staticVoucherCampaignUpdate
|
|
1337
|
+
*/
|
|
1338
|
+
public async updateStaticVoucherCampaign (campaignID: any, staticVoucherCampaignUpdate: StaticVoucherCampaignUpdate, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
1339
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/{campaignID}'
|
|
1340
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1341
|
+
let localVarQueryParameters: any = {};
|
|
1342
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1343
|
+
const produces = ['application/json'];
|
|
1344
|
+
// give precedence to 'application/json'
|
|
1345
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1346
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1347
|
+
} else {
|
|
1348
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1349
|
+
}
|
|
1350
|
+
let localVarFormParams: any = {};
|
|
1351
|
+
|
|
1352
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
1353
|
+
if (campaignID === null || campaignID === undefined) {
|
|
1354
|
+
throw new Error('Required parameter campaignID was null or undefined when calling updateStaticVoucherCampaign.');
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
// verify required parameter 'staticVoucherCampaignUpdate' is not null or undefined
|
|
1358
|
+
if (staticVoucherCampaignUpdate === null || staticVoucherCampaignUpdate === undefined) {
|
|
1359
|
+
throw new Error('Required parameter staticVoucherCampaignUpdate was null or undefined when calling updateStaticVoucherCampaign.');
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1363
|
+
|
|
1364
|
+
let localVarUseFormData = false;
|
|
1365
|
+
|
|
1366
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1367
|
+
method: 'PUT',
|
|
1368
|
+
qs: localVarQueryParameters,
|
|
1369
|
+
headers: localVarHeaderParams,
|
|
1370
|
+
uri: localVarPath,
|
|
1371
|
+
useQuerystring: this._useQuerystring,
|
|
1372
|
+
json: true,
|
|
1373
|
+
body: ObjectSerializer.serialize(staticVoucherCampaignUpdate, "StaticVoucherCampaignUpdate")
|
|
1374
|
+
};
|
|
1375
|
+
|
|
1376
|
+
let authenticationPromise = Promise.resolve();
|
|
1377
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1378
|
+
|
|
1379
|
+
let interceptorPromise = authenticationPromise;
|
|
1380
|
+
for (const interceptor of this.interceptors) {
|
|
1381
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
return interceptorPromise.then(() => {
|
|
1385
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1386
|
+
if (localVarUseFormData) {
|
|
1387
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1388
|
+
} else {
|
|
1389
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
1393
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1394
|
+
if (error) {
|
|
1395
|
+
reject(error);
|
|
1396
|
+
} else {
|
|
1397
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1398
|
+
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
1399
|
+
resolve({ response: response, body: body });
|
|
1400
|
+
} else {
|
|
1401
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
});
|
|
1405
|
+
});
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
*
|
|
1410
|
+
* @summary Update static voucher campaign with voucher
|
|
1411
|
+
* @param campaignID
|
|
1412
|
+
* @param updateStaticVoucherCampaignWithVoucher
|
|
1413
|
+
*/
|
|
1414
|
+
public async updateStaticVoucherCampaignWithVoucher (campaignID: any, updateStaticVoucherCampaignWithVoucher: UpdateStaticVoucherCampaignWithVoucher, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }> {
|
|
1415
|
+
const localVarPath = this.basePath + '/v1/payment/staticVoucherCampaign/voucher/{campaignID}'
|
|
1416
|
+
.replace('{' + 'campaignID' + '}', encodeURIComponent(String(campaignID)));
|
|
1417
|
+
let localVarQueryParameters: any = {};
|
|
1418
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
1419
|
+
const produces = ['application/json'];
|
|
1420
|
+
// give precedence to 'application/json'
|
|
1421
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1422
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1423
|
+
} else {
|
|
1424
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1425
|
+
}
|
|
1426
|
+
let localVarFormParams: any = {};
|
|
1427
|
+
|
|
1428
|
+
// verify required parameter 'campaignID' is not null or undefined
|
|
1429
|
+
if (campaignID === null || campaignID === undefined) {
|
|
1430
|
+
throw new Error('Required parameter campaignID was null or undefined when calling updateStaticVoucherCampaignWithVoucher.');
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// verify required parameter 'updateStaticVoucherCampaignWithVoucher' is not null or undefined
|
|
1434
|
+
if (updateStaticVoucherCampaignWithVoucher === null || updateStaticVoucherCampaignWithVoucher === undefined) {
|
|
1435
|
+
throw new Error('Required parameter updateStaticVoucherCampaignWithVoucher was null or undefined when calling updateStaticVoucherCampaignWithVoucher.');
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1439
|
+
|
|
1440
|
+
let localVarUseFormData = false;
|
|
1441
|
+
|
|
1442
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1443
|
+
method: 'PUT',
|
|
1444
|
+
qs: localVarQueryParameters,
|
|
1445
|
+
headers: localVarHeaderParams,
|
|
1446
|
+
uri: localVarPath,
|
|
1447
|
+
useQuerystring: this._useQuerystring,
|
|
1448
|
+
json: true,
|
|
1449
|
+
body: ObjectSerializer.serialize(updateStaticVoucherCampaignWithVoucher, "UpdateStaticVoucherCampaignWithVoucher")
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
let authenticationPromise = Promise.resolve();
|
|
1453
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1454
|
+
|
|
1455
|
+
let interceptorPromise = authenticationPromise;
|
|
1456
|
+
for (const interceptor of this.interceptors) {
|
|
1457
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
return interceptorPromise.then(() => {
|
|
1461
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1462
|
+
if (localVarUseFormData) {
|
|
1463
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1464
|
+
} else {
|
|
1465
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
return new Promise<{ response: http.IncomingMessage; body: WTStaticVoucherCampaign; }>((resolve, reject) => {
|
|
1469
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1470
|
+
if (error) {
|
|
1471
|
+
reject(error);
|
|
1472
|
+
} else {
|
|
1473
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1474
|
+
body = ObjectSerializer.deserialize(body, "WTStaticVoucherCampaign");
|
|
1475
|
+
resolve({ response: response, body: body });
|
|
1476
|
+
} else {
|
|
1477
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
});
|
|
1481
|
+
});
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
}
|