wallet 1.1.3 → 1.1.6
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/README.md +13 -1
- 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 +1 -26
- package/readme-generator.py +54 -42
- package/tsconfig.json +25 -25
package/api/newsApi.ts
CHANGED
|
@@ -1,447 +1,447 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* wallet-api
|
|
3
|
-
* API
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 1.1.
|
|
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 { FalsumError } from '../model/falsumError';
|
|
20
|
-
import { InternalServerError } from '../model/internalServerError';
|
|
21
|
-
import { NewsArticle } from '../model/newsArticle';
|
|
22
|
-
import { WTNewsArticleCreateParams } from '../model/wTNewsArticleCreateParams';
|
|
23
|
-
import { WTNewsArticleUpdateParams } from '../model/wTNewsArticleUpdateParams';
|
|
24
|
-
|
|
25
|
-
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
26
|
-
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
27
|
-
|
|
28
|
-
import { HttpError, RequestFile } from './apis';
|
|
29
|
-
|
|
30
|
-
let defaultBasePath = 'https://api.wall.et';
|
|
31
|
-
|
|
32
|
-
// ===============================================
|
|
33
|
-
// This file is autogenerated - Please do not edit
|
|
34
|
-
// ===============================================
|
|
35
|
-
|
|
36
|
-
export enum NewsApiApiKeys {
|
|
37
|
-
api_key,
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export class NewsApi {
|
|
41
|
-
protected _basePath = defaultBasePath;
|
|
42
|
-
protected _defaultHeaders : any = {};
|
|
43
|
-
protected _useQuerystring : boolean = false;
|
|
44
|
-
|
|
45
|
-
protected authentications = {
|
|
46
|
-
'default': <Authentication>new VoidAuth(),
|
|
47
|
-
'api_key': new ApiKeyAuth('header', 'access-token'),
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
protected interceptors: Interceptor[] = [];
|
|
51
|
-
|
|
52
|
-
constructor(basePath?: string);
|
|
53
|
-
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
54
|
-
if (password) {
|
|
55
|
-
if (basePath) {
|
|
56
|
-
this.basePath = basePath;
|
|
57
|
-
}
|
|
58
|
-
} else {
|
|
59
|
-
if (basePathOrUsername) {
|
|
60
|
-
this.basePath = basePathOrUsername
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
set useQuerystring(value: boolean) {
|
|
66
|
-
this._useQuerystring = value;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
set basePath(basePath: string) {
|
|
70
|
-
this._basePath = basePath;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
set defaultHeaders(defaultHeaders: any) {
|
|
74
|
-
this._defaultHeaders = defaultHeaders;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
get defaultHeaders() {
|
|
78
|
-
return this._defaultHeaders;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
get basePath() {
|
|
82
|
-
return this._basePath;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
public setDefaultAuthentication(auth: Authentication) {
|
|
86
|
-
this.authentications.default = auth;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
public setApiKey(key: NewsApiApiKeys, value: string) {
|
|
90
|
-
(this.authentications as any)[NewsApiApiKeys[key]].apiKey = value;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
public addInterceptor(interceptor: Interceptor) {
|
|
94
|
-
this.interceptors.push(interceptor);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
*
|
|
99
|
-
* @summary Archive news article
|
|
100
|
-
* @param id
|
|
101
|
-
*/
|
|
102
|
-
public async archiveNewsArticle (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NewsArticle; }> {
|
|
103
|
-
const localVarPath = this.basePath + '/v1/news/{id}'
|
|
104
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
105
|
-
let localVarQueryParameters: any = {};
|
|
106
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
107
|
-
const produces = ['application/json'];
|
|
108
|
-
// give precedence to 'application/json'
|
|
109
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
110
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
111
|
-
} else {
|
|
112
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
113
|
-
}
|
|
114
|
-
let localVarFormParams: any = {};
|
|
115
|
-
|
|
116
|
-
// verify required parameter 'id' is not null or undefined
|
|
117
|
-
if (id === null || id === undefined) {
|
|
118
|
-
throw new Error('Required parameter id was null or undefined when calling archiveNewsArticle.');
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
122
|
-
|
|
123
|
-
let localVarUseFormData = false;
|
|
124
|
-
|
|
125
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
126
|
-
method: 'DELETE',
|
|
127
|
-
qs: localVarQueryParameters,
|
|
128
|
-
headers: localVarHeaderParams,
|
|
129
|
-
uri: localVarPath,
|
|
130
|
-
useQuerystring: this._useQuerystring,
|
|
131
|
-
json: true,
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
let authenticationPromise = Promise.resolve();
|
|
135
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
136
|
-
|
|
137
|
-
let interceptorPromise = authenticationPromise;
|
|
138
|
-
for (const interceptor of this.interceptors) {
|
|
139
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
return interceptorPromise.then(() => {
|
|
143
|
-
if (Object.keys(localVarFormParams).length) {
|
|
144
|
-
if (localVarUseFormData) {
|
|
145
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
146
|
-
} else {
|
|
147
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return new Promise<{ response: http.IncomingMessage; body: NewsArticle; }>((resolve, reject) => {
|
|
151
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
152
|
-
if (error) {
|
|
153
|
-
reject(error);
|
|
154
|
-
} else {
|
|
155
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
156
|
-
body = ObjectSerializer.deserialize(body, "NewsArticle");
|
|
157
|
-
resolve({ response: response, body: body });
|
|
158
|
-
} else {
|
|
159
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
*
|
|
168
|
-
* @summary Create news article
|
|
169
|
-
* @param wTNewsArticleCreateParams
|
|
170
|
-
*/
|
|
171
|
-
public async createNewsArticle (wTNewsArticleCreateParams: WTNewsArticleCreateParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NewsArticle; }> {
|
|
172
|
-
const localVarPath = this.basePath + '/v1/news';
|
|
173
|
-
let localVarQueryParameters: any = {};
|
|
174
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
175
|
-
const produces = ['application/json'];
|
|
176
|
-
// give precedence to 'application/json'
|
|
177
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
178
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
179
|
-
} else {
|
|
180
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
181
|
-
}
|
|
182
|
-
let localVarFormParams: any = {};
|
|
183
|
-
|
|
184
|
-
// verify required parameter 'wTNewsArticleCreateParams' is not null or undefined
|
|
185
|
-
if (wTNewsArticleCreateParams === null || wTNewsArticleCreateParams === undefined) {
|
|
186
|
-
throw new Error('Required parameter wTNewsArticleCreateParams was null or undefined when calling createNewsArticle.');
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
190
|
-
|
|
191
|
-
let localVarUseFormData = false;
|
|
192
|
-
|
|
193
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
194
|
-
method: 'POST',
|
|
195
|
-
qs: localVarQueryParameters,
|
|
196
|
-
headers: localVarHeaderParams,
|
|
197
|
-
uri: localVarPath,
|
|
198
|
-
useQuerystring: this._useQuerystring,
|
|
199
|
-
json: true,
|
|
200
|
-
body: ObjectSerializer.serialize(wTNewsArticleCreateParams, "WTNewsArticleCreateParams")
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
let authenticationPromise = Promise.resolve();
|
|
204
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
205
|
-
|
|
206
|
-
let interceptorPromise = authenticationPromise;
|
|
207
|
-
for (const interceptor of this.interceptors) {
|
|
208
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
return interceptorPromise.then(() => {
|
|
212
|
-
if (Object.keys(localVarFormParams).length) {
|
|
213
|
-
if (localVarUseFormData) {
|
|
214
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
215
|
-
} else {
|
|
216
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
return new Promise<{ response: http.IncomingMessage; body: NewsArticle; }>((resolve, reject) => {
|
|
220
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
221
|
-
if (error) {
|
|
222
|
-
reject(error);
|
|
223
|
-
} else {
|
|
224
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
225
|
-
body = ObjectSerializer.deserialize(body, "NewsArticle");
|
|
226
|
-
resolve({ response: response, body: body });
|
|
227
|
-
} else {
|
|
228
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
*
|
|
237
|
-
* @summary Fetch all news articles
|
|
238
|
-
* @param isArchiveIncluded
|
|
239
|
-
*/
|
|
240
|
-
public async fetchAllNewsArticles (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
|
|
241
|
-
const localVarPath = this.basePath + '/v1/news/all';
|
|
242
|
-
let localVarQueryParameters: any = {};
|
|
243
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
244
|
-
const produces = ['application/json'];
|
|
245
|
-
// give precedence to 'application/json'
|
|
246
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
247
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
248
|
-
} else {
|
|
249
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
250
|
-
}
|
|
251
|
-
let localVarFormParams: any = {};
|
|
252
|
-
|
|
253
|
-
if (isArchiveIncluded !== undefined) {
|
|
254
|
-
localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
258
|
-
|
|
259
|
-
let localVarUseFormData = false;
|
|
260
|
-
|
|
261
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
262
|
-
method: 'GET',
|
|
263
|
-
qs: localVarQueryParameters,
|
|
264
|
-
headers: localVarHeaderParams,
|
|
265
|
-
uri: localVarPath,
|
|
266
|
-
useQuerystring: this._useQuerystring,
|
|
267
|
-
json: true,
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
let authenticationPromise = Promise.resolve();
|
|
271
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
272
|
-
|
|
273
|
-
let interceptorPromise = authenticationPromise;
|
|
274
|
-
for (const interceptor of this.interceptors) {
|
|
275
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return interceptorPromise.then(() => {
|
|
279
|
-
if (Object.keys(localVarFormParams).length) {
|
|
280
|
-
if (localVarUseFormData) {
|
|
281
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
282
|
-
} else {
|
|
283
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
|
|
287
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
288
|
-
if (error) {
|
|
289
|
-
reject(error);
|
|
290
|
-
} else {
|
|
291
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
292
|
-
body = ObjectSerializer.deserialize(body, "any");
|
|
293
|
-
resolve({ response: response, body: body });
|
|
294
|
-
} else {
|
|
295
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
});
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
*
|
|
304
|
-
* @summary Restore news article
|
|
305
|
-
* @param id
|
|
306
|
-
*/
|
|
307
|
-
public async restoreNewsArticle (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NewsArticle; }> {
|
|
308
|
-
const localVarPath = this.basePath + '/v1/news/{id}'
|
|
309
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
310
|
-
let localVarQueryParameters: any = {};
|
|
311
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
312
|
-
const produces = ['application/json'];
|
|
313
|
-
// give precedence to 'application/json'
|
|
314
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
315
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
316
|
-
} else {
|
|
317
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
318
|
-
}
|
|
319
|
-
let localVarFormParams: any = {};
|
|
320
|
-
|
|
321
|
-
// verify required parameter 'id' is not null or undefined
|
|
322
|
-
if (id === null || id === undefined) {
|
|
323
|
-
throw new Error('Required parameter id was null or undefined when calling restoreNewsArticle.');
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
327
|
-
|
|
328
|
-
let localVarUseFormData = false;
|
|
329
|
-
|
|
330
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
331
|
-
method: 'PATCH',
|
|
332
|
-
qs: localVarQueryParameters,
|
|
333
|
-
headers: localVarHeaderParams,
|
|
334
|
-
uri: localVarPath,
|
|
335
|
-
useQuerystring: this._useQuerystring,
|
|
336
|
-
json: true,
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
let authenticationPromise = Promise.resolve();
|
|
340
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
341
|
-
|
|
342
|
-
let interceptorPromise = authenticationPromise;
|
|
343
|
-
for (const interceptor of this.interceptors) {
|
|
344
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
return interceptorPromise.then(() => {
|
|
348
|
-
if (Object.keys(localVarFormParams).length) {
|
|
349
|
-
if (localVarUseFormData) {
|
|
350
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
351
|
-
} else {
|
|
352
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
return new Promise<{ response: http.IncomingMessage; body: NewsArticle; }>((resolve, reject) => {
|
|
356
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
357
|
-
if (error) {
|
|
358
|
-
reject(error);
|
|
359
|
-
} else {
|
|
360
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
361
|
-
body = ObjectSerializer.deserialize(body, "NewsArticle");
|
|
362
|
-
resolve({ response: response, body: body });
|
|
363
|
-
} else {
|
|
364
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
});
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
*
|
|
373
|
-
* @summary Update news article
|
|
374
|
-
* @param id
|
|
375
|
-
* @param wTNewsArticleUpdateParams
|
|
376
|
-
*/
|
|
377
|
-
public async updateNewsArticle (id: any, wTNewsArticleUpdateParams: WTNewsArticleUpdateParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NewsArticle; }> {
|
|
378
|
-
const localVarPath = this.basePath + '/v1/news/{id}'
|
|
379
|
-
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
380
|
-
let localVarQueryParameters: any = {};
|
|
381
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
382
|
-
const produces = ['application/json'];
|
|
383
|
-
// give precedence to 'application/json'
|
|
384
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
385
|
-
localVarHeaderParams.Accept = 'application/json';
|
|
386
|
-
} else {
|
|
387
|
-
localVarHeaderParams.Accept = produces.join(',');
|
|
388
|
-
}
|
|
389
|
-
let localVarFormParams: any = {};
|
|
390
|
-
|
|
391
|
-
// verify required parameter 'id' is not null or undefined
|
|
392
|
-
if (id === null || id === undefined) {
|
|
393
|
-
throw new Error('Required parameter id was null or undefined when calling updateNewsArticle.');
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
// verify required parameter 'wTNewsArticleUpdateParams' is not null or undefined
|
|
397
|
-
if (wTNewsArticleUpdateParams === null || wTNewsArticleUpdateParams === undefined) {
|
|
398
|
-
throw new Error('Required parameter wTNewsArticleUpdateParams was null or undefined when calling updateNewsArticle.');
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
402
|
-
|
|
403
|
-
let localVarUseFormData = false;
|
|
404
|
-
|
|
405
|
-
let localVarRequestOptions: localVarRequest.Options = {
|
|
406
|
-
method: 'PUT',
|
|
407
|
-
qs: localVarQueryParameters,
|
|
408
|
-
headers: localVarHeaderParams,
|
|
409
|
-
uri: localVarPath,
|
|
410
|
-
useQuerystring: this._useQuerystring,
|
|
411
|
-
json: true,
|
|
412
|
-
body: ObjectSerializer.serialize(wTNewsArticleUpdateParams, "WTNewsArticleUpdateParams")
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
let authenticationPromise = Promise.resolve();
|
|
416
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
417
|
-
|
|
418
|
-
let interceptorPromise = authenticationPromise;
|
|
419
|
-
for (const interceptor of this.interceptors) {
|
|
420
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
return interceptorPromise.then(() => {
|
|
424
|
-
if (Object.keys(localVarFormParams).length) {
|
|
425
|
-
if (localVarUseFormData) {
|
|
426
|
-
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
427
|
-
} else {
|
|
428
|
-
localVarRequestOptions.form = localVarFormParams;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
return new Promise<{ response: http.IncomingMessage; body: NewsArticle; }>((resolve, reject) => {
|
|
432
|
-
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
433
|
-
if (error) {
|
|
434
|
-
reject(error);
|
|
435
|
-
} else {
|
|
436
|
-
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
437
|
-
body = ObjectSerializer.deserialize(body, "NewsArticle");
|
|
438
|
-
resolve({ response: response, body: body });
|
|
439
|
-
} else {
|
|
440
|
-
reject(new HttpError(response, body, response.statusCode));
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
});
|
|
444
|
-
});
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* wallet-api
|
|
3
|
+
* API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.1.6
|
|
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 { FalsumError } from '../model/falsumError';
|
|
20
|
+
import { InternalServerError } from '../model/internalServerError';
|
|
21
|
+
import { NewsArticle } from '../model/newsArticle';
|
|
22
|
+
import { WTNewsArticleCreateParams } from '../model/wTNewsArticleCreateParams';
|
|
23
|
+
import { WTNewsArticleUpdateParams } from '../model/wTNewsArticleUpdateParams';
|
|
24
|
+
|
|
25
|
+
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
|
|
26
|
+
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
|
|
27
|
+
|
|
28
|
+
import { HttpError, RequestFile } from './apis';
|
|
29
|
+
|
|
30
|
+
let defaultBasePath = 'https://api.wall.et';
|
|
31
|
+
|
|
32
|
+
// ===============================================
|
|
33
|
+
// This file is autogenerated - Please do not edit
|
|
34
|
+
// ===============================================
|
|
35
|
+
|
|
36
|
+
export enum NewsApiApiKeys {
|
|
37
|
+
api_key,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class NewsApi {
|
|
41
|
+
protected _basePath = defaultBasePath;
|
|
42
|
+
protected _defaultHeaders : any = {};
|
|
43
|
+
protected _useQuerystring : boolean = false;
|
|
44
|
+
|
|
45
|
+
protected authentications = {
|
|
46
|
+
'default': <Authentication>new VoidAuth(),
|
|
47
|
+
'api_key': new ApiKeyAuth('header', 'access-token'),
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
protected interceptors: Interceptor[] = [];
|
|
51
|
+
|
|
52
|
+
constructor(basePath?: string);
|
|
53
|
+
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
|
|
54
|
+
if (password) {
|
|
55
|
+
if (basePath) {
|
|
56
|
+
this.basePath = basePath;
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
if (basePathOrUsername) {
|
|
60
|
+
this.basePath = basePathOrUsername
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
set useQuerystring(value: boolean) {
|
|
66
|
+
this._useQuerystring = value;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
set basePath(basePath: string) {
|
|
70
|
+
this._basePath = basePath;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
74
|
+
this._defaultHeaders = defaultHeaders;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
get defaultHeaders() {
|
|
78
|
+
return this._defaultHeaders;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
get basePath() {
|
|
82
|
+
return this._basePath;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
86
|
+
this.authentications.default = auth;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public setApiKey(key: NewsApiApiKeys, value: string) {
|
|
90
|
+
(this.authentications as any)[NewsApiApiKeys[key]].apiKey = value;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
94
|
+
this.interceptors.push(interceptor);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
*
|
|
99
|
+
* @summary Archive news article
|
|
100
|
+
* @param id
|
|
101
|
+
*/
|
|
102
|
+
public async archiveNewsArticle (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NewsArticle; }> {
|
|
103
|
+
const localVarPath = this.basePath + '/v1/news/{id}'
|
|
104
|
+
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
105
|
+
let localVarQueryParameters: any = {};
|
|
106
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
107
|
+
const produces = ['application/json'];
|
|
108
|
+
// give precedence to 'application/json'
|
|
109
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
110
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
111
|
+
} else {
|
|
112
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
113
|
+
}
|
|
114
|
+
let localVarFormParams: any = {};
|
|
115
|
+
|
|
116
|
+
// verify required parameter 'id' is not null or undefined
|
|
117
|
+
if (id === null || id === undefined) {
|
|
118
|
+
throw new Error('Required parameter id was null or undefined when calling archiveNewsArticle.');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
122
|
+
|
|
123
|
+
let localVarUseFormData = false;
|
|
124
|
+
|
|
125
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
126
|
+
method: 'DELETE',
|
|
127
|
+
qs: localVarQueryParameters,
|
|
128
|
+
headers: localVarHeaderParams,
|
|
129
|
+
uri: localVarPath,
|
|
130
|
+
useQuerystring: this._useQuerystring,
|
|
131
|
+
json: true,
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
let authenticationPromise = Promise.resolve();
|
|
135
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
136
|
+
|
|
137
|
+
let interceptorPromise = authenticationPromise;
|
|
138
|
+
for (const interceptor of this.interceptors) {
|
|
139
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return interceptorPromise.then(() => {
|
|
143
|
+
if (Object.keys(localVarFormParams).length) {
|
|
144
|
+
if (localVarUseFormData) {
|
|
145
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
146
|
+
} else {
|
|
147
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return new Promise<{ response: http.IncomingMessage; body: NewsArticle; }>((resolve, reject) => {
|
|
151
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
152
|
+
if (error) {
|
|
153
|
+
reject(error);
|
|
154
|
+
} else {
|
|
155
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
156
|
+
body = ObjectSerializer.deserialize(body, "NewsArticle");
|
|
157
|
+
resolve({ response: response, body: body });
|
|
158
|
+
} else {
|
|
159
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
*
|
|
168
|
+
* @summary Create news article
|
|
169
|
+
* @param wTNewsArticleCreateParams
|
|
170
|
+
*/
|
|
171
|
+
public async createNewsArticle (wTNewsArticleCreateParams: WTNewsArticleCreateParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NewsArticle; }> {
|
|
172
|
+
const localVarPath = this.basePath + '/v1/news';
|
|
173
|
+
let localVarQueryParameters: any = {};
|
|
174
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
175
|
+
const produces = ['application/json'];
|
|
176
|
+
// give precedence to 'application/json'
|
|
177
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
178
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
179
|
+
} else {
|
|
180
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
181
|
+
}
|
|
182
|
+
let localVarFormParams: any = {};
|
|
183
|
+
|
|
184
|
+
// verify required parameter 'wTNewsArticleCreateParams' is not null or undefined
|
|
185
|
+
if (wTNewsArticleCreateParams === null || wTNewsArticleCreateParams === undefined) {
|
|
186
|
+
throw new Error('Required parameter wTNewsArticleCreateParams was null or undefined when calling createNewsArticle.');
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
190
|
+
|
|
191
|
+
let localVarUseFormData = false;
|
|
192
|
+
|
|
193
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
194
|
+
method: 'POST',
|
|
195
|
+
qs: localVarQueryParameters,
|
|
196
|
+
headers: localVarHeaderParams,
|
|
197
|
+
uri: localVarPath,
|
|
198
|
+
useQuerystring: this._useQuerystring,
|
|
199
|
+
json: true,
|
|
200
|
+
body: ObjectSerializer.serialize(wTNewsArticleCreateParams, "WTNewsArticleCreateParams")
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
let authenticationPromise = Promise.resolve();
|
|
204
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
205
|
+
|
|
206
|
+
let interceptorPromise = authenticationPromise;
|
|
207
|
+
for (const interceptor of this.interceptors) {
|
|
208
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return interceptorPromise.then(() => {
|
|
212
|
+
if (Object.keys(localVarFormParams).length) {
|
|
213
|
+
if (localVarUseFormData) {
|
|
214
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
215
|
+
} else {
|
|
216
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
return new Promise<{ response: http.IncomingMessage; body: NewsArticle; }>((resolve, reject) => {
|
|
220
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
221
|
+
if (error) {
|
|
222
|
+
reject(error);
|
|
223
|
+
} else {
|
|
224
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
225
|
+
body = ObjectSerializer.deserialize(body, "NewsArticle");
|
|
226
|
+
resolve({ response: response, body: body });
|
|
227
|
+
} else {
|
|
228
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
*
|
|
237
|
+
* @summary Fetch all news articles
|
|
238
|
+
* @param isArchiveIncluded
|
|
239
|
+
*/
|
|
240
|
+
public async fetchAllNewsArticles (isArchiveIncluded?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: any; }> {
|
|
241
|
+
const localVarPath = this.basePath + '/v1/news/all';
|
|
242
|
+
let localVarQueryParameters: any = {};
|
|
243
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
244
|
+
const produces = ['application/json'];
|
|
245
|
+
// give precedence to 'application/json'
|
|
246
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
247
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
248
|
+
} else {
|
|
249
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
250
|
+
}
|
|
251
|
+
let localVarFormParams: any = {};
|
|
252
|
+
|
|
253
|
+
if (isArchiveIncluded !== undefined) {
|
|
254
|
+
localVarQueryParameters['isArchiveIncluded'] = ObjectSerializer.serialize(isArchiveIncluded, "boolean");
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
258
|
+
|
|
259
|
+
let localVarUseFormData = false;
|
|
260
|
+
|
|
261
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
262
|
+
method: 'GET',
|
|
263
|
+
qs: localVarQueryParameters,
|
|
264
|
+
headers: localVarHeaderParams,
|
|
265
|
+
uri: localVarPath,
|
|
266
|
+
useQuerystring: this._useQuerystring,
|
|
267
|
+
json: true,
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
let authenticationPromise = Promise.resolve();
|
|
271
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
272
|
+
|
|
273
|
+
let interceptorPromise = authenticationPromise;
|
|
274
|
+
for (const interceptor of this.interceptors) {
|
|
275
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return interceptorPromise.then(() => {
|
|
279
|
+
if (Object.keys(localVarFormParams).length) {
|
|
280
|
+
if (localVarUseFormData) {
|
|
281
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
282
|
+
} else {
|
|
283
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return new Promise<{ response: http.IncomingMessage; body: any; }>((resolve, reject) => {
|
|
287
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
288
|
+
if (error) {
|
|
289
|
+
reject(error);
|
|
290
|
+
} else {
|
|
291
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
292
|
+
body = ObjectSerializer.deserialize(body, "any");
|
|
293
|
+
resolve({ response: response, body: body });
|
|
294
|
+
} else {
|
|
295
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
*
|
|
304
|
+
* @summary Restore news article
|
|
305
|
+
* @param id
|
|
306
|
+
*/
|
|
307
|
+
public async restoreNewsArticle (id: any, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NewsArticle; }> {
|
|
308
|
+
const localVarPath = this.basePath + '/v1/news/{id}'
|
|
309
|
+
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
310
|
+
let localVarQueryParameters: any = {};
|
|
311
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
312
|
+
const produces = ['application/json'];
|
|
313
|
+
// give precedence to 'application/json'
|
|
314
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
315
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
316
|
+
} else {
|
|
317
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
318
|
+
}
|
|
319
|
+
let localVarFormParams: any = {};
|
|
320
|
+
|
|
321
|
+
// verify required parameter 'id' is not null or undefined
|
|
322
|
+
if (id === null || id === undefined) {
|
|
323
|
+
throw new Error('Required parameter id was null or undefined when calling restoreNewsArticle.');
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
327
|
+
|
|
328
|
+
let localVarUseFormData = false;
|
|
329
|
+
|
|
330
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
331
|
+
method: 'PATCH',
|
|
332
|
+
qs: localVarQueryParameters,
|
|
333
|
+
headers: localVarHeaderParams,
|
|
334
|
+
uri: localVarPath,
|
|
335
|
+
useQuerystring: this._useQuerystring,
|
|
336
|
+
json: true,
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
let authenticationPromise = Promise.resolve();
|
|
340
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
341
|
+
|
|
342
|
+
let interceptorPromise = authenticationPromise;
|
|
343
|
+
for (const interceptor of this.interceptors) {
|
|
344
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
return interceptorPromise.then(() => {
|
|
348
|
+
if (Object.keys(localVarFormParams).length) {
|
|
349
|
+
if (localVarUseFormData) {
|
|
350
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
351
|
+
} else {
|
|
352
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return new Promise<{ response: http.IncomingMessage; body: NewsArticle; }>((resolve, reject) => {
|
|
356
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
357
|
+
if (error) {
|
|
358
|
+
reject(error);
|
|
359
|
+
} else {
|
|
360
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
361
|
+
body = ObjectSerializer.deserialize(body, "NewsArticle");
|
|
362
|
+
resolve({ response: response, body: body });
|
|
363
|
+
} else {
|
|
364
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
*
|
|
373
|
+
* @summary Update news article
|
|
374
|
+
* @param id
|
|
375
|
+
* @param wTNewsArticleUpdateParams
|
|
376
|
+
*/
|
|
377
|
+
public async updateNewsArticle (id: any, wTNewsArticleUpdateParams: WTNewsArticleUpdateParams, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NewsArticle; }> {
|
|
378
|
+
const localVarPath = this.basePath + '/v1/news/{id}'
|
|
379
|
+
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
|
|
380
|
+
let localVarQueryParameters: any = {};
|
|
381
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
382
|
+
const produces = ['application/json'];
|
|
383
|
+
// give precedence to 'application/json'
|
|
384
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
385
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
386
|
+
} else {
|
|
387
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
388
|
+
}
|
|
389
|
+
let localVarFormParams: any = {};
|
|
390
|
+
|
|
391
|
+
// verify required parameter 'id' is not null or undefined
|
|
392
|
+
if (id === null || id === undefined) {
|
|
393
|
+
throw new Error('Required parameter id was null or undefined when calling updateNewsArticle.');
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
// verify required parameter 'wTNewsArticleUpdateParams' is not null or undefined
|
|
397
|
+
if (wTNewsArticleUpdateParams === null || wTNewsArticleUpdateParams === undefined) {
|
|
398
|
+
throw new Error('Required parameter wTNewsArticleUpdateParams was null or undefined when calling updateNewsArticle.');
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
402
|
+
|
|
403
|
+
let localVarUseFormData = false;
|
|
404
|
+
|
|
405
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
406
|
+
method: 'PUT',
|
|
407
|
+
qs: localVarQueryParameters,
|
|
408
|
+
headers: localVarHeaderParams,
|
|
409
|
+
uri: localVarPath,
|
|
410
|
+
useQuerystring: this._useQuerystring,
|
|
411
|
+
json: true,
|
|
412
|
+
body: ObjectSerializer.serialize(wTNewsArticleUpdateParams, "WTNewsArticleUpdateParams")
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
let authenticationPromise = Promise.resolve();
|
|
416
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
417
|
+
|
|
418
|
+
let interceptorPromise = authenticationPromise;
|
|
419
|
+
for (const interceptor of this.interceptors) {
|
|
420
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return interceptorPromise.then(() => {
|
|
424
|
+
if (Object.keys(localVarFormParams).length) {
|
|
425
|
+
if (localVarUseFormData) {
|
|
426
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
427
|
+
} else {
|
|
428
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
return new Promise<{ response: http.IncomingMessage; body: NewsArticle; }>((resolve, reject) => {
|
|
432
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
433
|
+
if (error) {
|
|
434
|
+
reject(error);
|
|
435
|
+
} else {
|
|
436
|
+
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
437
|
+
body = ObjectSerializer.deserialize(body, "NewsArticle");
|
|
438
|
+
resolve({ response: response, body: body });
|
|
439
|
+
} else {
|
|
440
|
+
reject(new HttpError(response, body, response.statusCode));
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
}
|