diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index 76add87..0000000
--- a/.eslintignore
+++ /dev/null
@@ -1,2 +0,0 @@
-node_modules
-dist
\ No newline at end of file
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index 0da1e0a..0000000
--- a/.eslintrc
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "root": true,
- "parser": "@typescript-eslint/parser",
- "plugins": [
- "@typescript-eslint",
- "unused-imports"
- ],
- "extends": [
- "eslint:recommended",
- "plugin:@typescript-eslint/eslint-recommended",
- "plugin:@typescript-eslint/recommended"
- ],
- "rules": {
- "unused-imports/no-unused-imports-ts" : 2,
- "@typescript-eslint/ban-types" : "off",
- "@typescript-eslint/no-explicit-any": "off",
- "@typescript-eslint/no-namespace": "off",
- "no-self-assign": "off",
- "@typescript-eslint/adjacent-overload-signatures": "off",
- "@typescript-eslint/explicit-module-boundary-types": "off"
- }
- }
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 149b576..f9d5d17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,5 @@ wwwroot/*.js
node_modules
typings
dist
+
+git_push.sh
diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore
index c5fa491..7484ee5 100644
--- a/.openapi-generator-ignore
+++ b/.openapi-generator-ignore
@@ -1,11 +1,11 @@
-# Swagger Codegen Ignore
-# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
-# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
index 6f01056..973ac62 100644
--- a/.openapi-generator/FILES
+++ b/.openapi-generator/FILES
@@ -1,7 +1,9 @@
.gitignore
+.openapi-generator-ignore
api.ts
api/accountApi.ts
api/apis.ts
+api/balanceApi.ts
api/companiesApi.ts
api/contactsApi.ts
api/conversationsApi.ts
@@ -10,7 +12,7 @@ api/dealsApi.ts
api/domainsApi.ts
api/ecommerceApi.ts
api/emailCampaignsApi.ts
-api/eventsApi.ts
+api/eventApi.ts
api/externalFeedsApi.ts
api/filesApi.ts
api/inboundParsingApi.ts
@@ -18,10 +20,12 @@ api/masterAccountApi.ts
api/notesApi.ts
api/paymentsApi.ts
api/processApi.ts
-api/resellerApi.ts
+api/programApi.ts
+api/rewardApi.ts
api/sMSCampaignsApi.ts
api/sendersApi.ts
api/tasksApi.ts
+api/tierApi.ts
api/transactionalEmailsApi.ts
api/transactionalSMSApi.ts
api/transactionalWhatsAppApi.ts
@@ -34,13 +38,24 @@ model/abTestCampaignResultClickedLinks.ts
model/abTestCampaignResultStatistics.ts
model/abTestVersionClicksInner.ts
model/abTestVersionStats.ts
-model/addChildDomain.ts
-model/addContactToList.ts
-model/addCredits.ts
+model/addContactToListByEmails.ts
+model/addContactToListByExtIDs.ts
+model/addContactToListByIDs.ts
+model/addContactToListRequest.ts
+model/addSubscriptionMemberPayload.ts
+model/aggregateBalance.ts
model/authenticateDomainModel.ts
+model/balance.ts
+model/balanceDataPerContact.ts
+model/balanceDefinition.ts
+model/balanceDefinitionPage.ts
+model/balanceLimit.ts
+model/balanceOrder.ts
model/blockDomain.ts
model/cart.ts
model/companiesIdPatchRequest.ts
+model/companiesImportPost200Response.ts
+model/companiesImportPost400Response.ts
model/companiesLinkUnlinkIdPatchRequest.ts
model/companiesList.ts
model/companiesPost200Response.ts
@@ -49,13 +64,14 @@ model/company.ts
model/companyAttributesInner.ts
model/componentItems.ts
model/configuration.ts
+model/contactBalancesResp.ts
+model/contactErrorModel.ts
model/conversationsAgentOnlinePingPostRequest.ts
model/conversationsMessage.ts
model/conversationsMessageFile.ts
model/conversationsMessageFileImageInfo.ts
model/conversationsMessagesIdPutRequest.ts
model/conversationsMessagesPostRequest.ts
-model/conversationsPushedMessagesIdPutRequest.ts
model/conversationsPushedMessagesPostRequest.ts
model/conversionSourceMetrics.ts
model/conversionSourceProduct.ts
@@ -63,38 +79,49 @@ model/corporateGroupDetailsResponse.ts
model/corporateGroupDetailsResponseGroup.ts
model/corporateGroupDetailsResponseSubAccountsInner.ts
model/corporateGroupDetailsResponseUsersInner.ts
+model/corporateGroupIdPutRequest.ts
model/corporateGroupPost201Response.ts
model/corporateGroupPostRequest.ts
model/corporateGroupUnlinkGroupIdSubAccountsPutRequest.ts
+model/corporateIpGet200ResponseInner.ts
+model/corporateSsoTokenPostRequest.ts
model/corporateSubAccountIpAssociatePostRequest.ts
model/corporateSubAccountIpDissociatePutRequest.ts
+model/corporateSubAccountKeyPostRequest.ts
+model/corporateSubAccountSsoTokenPostRequest.ts
+model/corporateUserEmailPermissionsPutRequest.ts
+model/corporateUserEmailPermissionsPutRequestPrivilegesInner.ts
model/corporateUserInvitationActionEmailPut200Response.ts
-model/createApiKeyRequest.ts
model/createApiKeyResponse.ts
model/createAttribute.ts
model/createAttributeEnumerationInner.ts
+model/createBalanceDefinitionPayload.ts
+model/createBalanceLimitPayload.ts
+model/createBalancePayload.ts
model/createCategoryModel.ts
-model/createChild.ts
model/createContact.ts
model/createCouponCollection201Response.ts
model/createCouponCollectionRequest.ts
model/createCouponsRequest.ts
model/createDoiContact.ts
+model/createDoiContactAttributesValue.ts
model/createDomain.ts
model/createDomainModel.ts
model/createDomainModelDnsRecords.ts
model/createDomainModelDnsRecordsDkimRecord.ts
model/createEmailCampaign.ts
+model/createEmailCampaignEmailExpirationDate.ts
model/createEmailCampaignRecipients.ts
model/createEmailCampaignSender.ts
model/createExternalFeed.ts
model/createExternalFeed201Response.ts
model/createList.ts
+model/createLoyaltyProgramPayload.ts
model/createModel.ts
+model/createOrderPayload.ts
model/createPaymentRequest.ts
model/createPaymentResponse.ts
model/createProductModel.ts
-model/createReseller.ts
model/createSender.ts
model/createSenderIpsInner.ts
model/createSenderModel.ts
@@ -105,6 +132,10 @@ model/createSmtpTemplate.ts
model/createSmtpTemplateSender.ts
model/createSubAccount.ts
model/createSubAccountResponse.ts
+model/createSubscriptionPayload.ts
+model/createSubscriptionResponse.ts
+model/createTierGroupRequest.ts
+model/createTransactionPayload.ts
model/createUpdateBatchCategory.ts
model/createUpdateBatchCategoryModel.ts
model/createUpdateBatchProducts.ts
@@ -121,6 +152,8 @@ model/createWhatsAppCampaignRecipients.ts
model/createWhatsAppTemplate.ts
model/createdBatchId.ts
model/createdProcessId.ts
+model/crmAttributesPost200Response.ts
+model/crmAttributesPostRequest.ts
model/crmDealsIdPatchRequest.ts
model/crmDealsLinkUnlinkIdPatchRequest.ts
model/crmDealsPost201Response.ts
@@ -139,9 +172,13 @@ model/ecommerceAttributionProductsConversionSourceConversionSourceIdGet200Respon
model/ecommerceConfigDisplayCurrencyGet200Response.ts
model/emailExportRecipients.ts
model/errorModel.ts
+model/errorResponse.ts
model/event.ts
+model/eventContactPropertiesValue.ts
+model/eventEventPropertiesValue.ts
model/eventIdentifiers.ts
model/exportWebhooksHistory.ts
+model/exportWebhooksHistoryRequest.ts
model/fileData.ts
model/fileDownloadableLink.ts
model/getAccount.ts
@@ -163,27 +200,14 @@ model/getCampaignRecipients.ts
model/getCampaignStats.ts
model/getCategories.ts
model/getCategoryDetails.ts
-model/getChildAccountCreationStatus.ts
-model/getChildDomain.ts
-model/getChildInfo.ts
-model/getChildInfoAllOfApiKeys.ts
-model/getChildInfoAllOfApiKeysV2.ts
-model/getChildInfoAllOfApiKeysV3.ts
-model/getChildInfoAllOfCredits.ts
-model/getChildInfoAllOfStatistics.ts
-model/getChildrenList.ts
-model/getChildrenListChildrenInner.ts
model/getClient.ts
model/getContactCampaignStats.ts
model/getContactCampaignStatsClickedInner.ts
-model/getContactCampaignStatsClickedInnerLinksInner.ts
-model/getContactCampaignStatsMessagesSentInner.ts
model/getContactCampaignStatsOpenedInner.ts
model/getContactCampaignStatsTransacAttributesInner.ts
model/getContactCampaignStatsUnsubscriptions.ts
-model/getContactCampaignStatsUnsubscriptionsAdminUnsubscriptionInner.ts
-model/getContactCampaignStatsUnsubscriptionsUserUnsubscriptionInner.ts
model/getContactDetails.ts
+model/getContactInfoIdentifierParameter.ts
model/getContacts.ts
model/getCorporateInvitedUsersList.ts
model/getCorporateInvitedUsersListUsersInner.ts
@@ -238,8 +262,6 @@ model/getIpsFromSender.ts
model/getList.ts
model/getLists.ts
model/getListsListsInner.ts
-model/getOrders.ts
-model/getOrdersOrdersInner.ts
model/getPaymentRequest.ts
model/getProcess.ts
model/getProcesses.ts
@@ -249,9 +271,9 @@ model/getReports.ts
model/getReportsReportsInner.ts
model/getScheduledEmailByBatchId.ts
model/getScheduledEmailByBatchIdBatchesInner.ts
+model/getScheduledEmailById200Response.ts
model/getScheduledEmailByMessageId.ts
model/getSegments.ts
-model/getSegmentsSegments.ts
model/getSendersList.ts
model/getSendersListSendersInner.ts
model/getSendersListSendersInnerIpsInner.ts
@@ -281,11 +303,7 @@ model/getTransacSmsReport.ts
model/getTransacSmsReportReportsInner.ts
model/getUserPermission.ts
model/getUserPermissionPrivilegesInner.ts
-model/getWATemplates.ts
-model/getWATemplatesTemplatesInner.ts
model/getWebhook.ts
-model/getWebhookAuth.ts
-model/getWebhookHeadersInner.ts
model/getWebhooks.ts
model/getWhatsAppConfig.ts
model/getWhatsappCampaignOverview.ts
@@ -293,17 +311,58 @@ model/getWhatsappCampaigns.ts
model/getWhatsappCampaignsCampaignsInner.ts
model/getWhatsappEventReport.ts
model/getWhatsappEventReportEventsInner.ts
+model/getWhatsappTemplates.ts
+model/getWhatsappTemplatesTemplatesInner.ts
model/inviteAdminUser.ts
model/inviteAdminUserPrivilegesInner.ts
model/inviteuser.ts
model/inviteuserPrivilegesInner.ts
-model/manageIp.ts
+model/inviteuserResponse.ts
+model/loyaltyProgram.ts
+model/loyaltyProgramPage.ts
+model/loyaltyProgramValidationError.ts
+model/loyaltyTierPage.ts
+model/mainAttributeRewardPayload.ts
+model/mainBillingPayload.ts
+model/mainCodeCountHttpResponse.ts
+model/mainCreateRedeemPayload.ts
+model/mainCreateRewardPayload.ts
+model/mainCreateRewardResponse.ts
+model/mainErrorResponse.ts
+model/mainFilter.ts
+model/mainGenerator.ts
+model/mainGetContactRewardsPayload.ts
+model/mainIdentifiersPayload.ts
+model/mainLimit.ts
+model/mainModelContactReward.ts
+model/mainModelContactRewardsResp.ts
+model/mainNodeResponse.ts
+model/mainOrderPayload.ts
+model/mainProduct.ts
+model/mainProductPayload.ts
+model/mainRedeem.ts
+model/mainResultParameterResponse.ts
+model/mainReward.ts
+model/mainRewardAttribution.ts
+model/mainRewardConfigurations.ts
+model/mainRewardPage.ts
+model/mainRewardPageObj.ts
+model/mainRewardValidate.ts
+model/mainRule.ts
+model/mainRuleConditionResponse.ts
+model/mainRuleEventResponse.ts
+model/mainRuleResultResponse.ts
+model/mainValidateRewardPayload.ts
+model/mainValueResponse.ts
+model/mainVoucherRevokePayload.ts
model/masterDetailsResponse.ts
model/masterDetailsResponseBillingInfo.ts
model/masterDetailsResponseBillingInfoAddress.ts
model/masterDetailsResponseBillingInfoName.ts
model/masterDetailsResponsePlanInfo.ts
model/masterDetailsResponsePlanInfoFeaturesInner.ts
+model/memberContact.ts
+model/modelSubscriptionBalanceResp.ts
model/models.ts
model/note.ts
model/noteData.ts
@@ -312,21 +371,28 @@ model/notification.ts
model/order.ts
model/orderBatch.ts
model/orderBilling.ts
+model/orderIdentifiers.ts
+model/orderMetaInfoValue.ts
model/orderProductsInner.ts
model/otp.ts
+model/patchLoyaltyProgramPayload.ts
model/pipeline.ts
model/pipelineStage.ts
model/postContactInfo.ts
model/postContactInfoContacts.ts
+model/postContactInfoContactsFailure.ts
+model/postContactInfoContactsSuccess.ts
model/postSendFailed.ts
model/postSendSmsTestFailed.ts
model/putRevokeUserPermission.ts
+model/putRevokeUserPermissionResponse.ts
model/putresendcancelinvitation.ts
-model/remainingCreditModel.ts
-model/remainingCreditModelChild.ts
-model/remainingCreditModelReseller.ts
-model/removeContactFromList.ts
-model/removeCredits.ts
+model/putresendcancelinvitationResponse.ts
+model/removeContactFromListByAll.ts
+model/removeContactFromListByEmails.ts
+model/removeContactFromListByExtIDs.ts
+model/removeContactFromListByIDs.ts
+model/removeContactFromListRequest.ts
model/requestContactExport.ts
model/requestContactExportCustomContactFilter.ts
model/requestContactImport.ts
@@ -337,34 +403,36 @@ model/scheduleSmtpEmail.ts
model/sendReport.ts
model/sendReportEmail.ts
model/sendSms.ts
+model/sendSmsAsync.ts
model/sendSmtpEmail.ts
model/sendSmtpEmailAttachmentInner.ts
model/sendSmtpEmailBccInner.ts
model/sendSmtpEmailCcInner.ts
model/sendSmtpEmailMessageVersionsInner.ts
-model/sendSmtpEmailMessageVersionsInnerReplyTo.ts
-model/sendSmtpEmailMessageVersionsInnerToInner.ts
model/sendSmtpEmailReplyTo.ts
model/sendSmtpEmailSender.ts
model/sendSmtpEmailToInner.ts
model/sendTestEmail.ts
model/sendTestSms.ts
model/sendTransacSms.ts
-model/sendWhatsappMessage.ts
model/sendWhatsappMessage201Response.ts
-model/ssoTokenRequest.ts
-model/ssoTokenRequestCorporate.ts
+model/sendWhatsappMessageRequest.ts
+model/sendWhatsappMessageTemplate.ts
+model/sendWhatsappMessageText.ts
model/subAccountAppsToggleRequest.ts
model/subAccountDetailsResponse.ts
model/subAccountDetailsResponseGroupsInner.ts
model/subAccountDetailsResponsePlanInfo.ts
model/subAccountDetailsResponsePlanInfoCredits.ts
model/subAccountDetailsResponsePlanInfoCreditsEmails.ts
+model/subAccountDetailsResponsePlanInfoCreditsExternalFeeds.ts
model/subAccountDetailsResponsePlanInfoCreditsSms.ts
+model/subAccountDetailsResponsePlanInfoCreditsWhatsapp.ts
model/subAccountDetailsResponsePlanInfoCreditsWpSubscribers.ts
model/subAccountDetailsResponsePlanInfoFeatures.ts
model/subAccountDetailsResponsePlanInfoFeaturesInbox.ts
model/subAccountDetailsResponsePlanInfoFeaturesLandingPage.ts
+model/subAccountDetailsResponsePlanInfoFeaturesSalesUsers.ts
model/subAccountDetailsResponsePlanInfoFeaturesUsers.ts
model/subAccountUpdatePlanRequest.ts
model/subAccountUpdatePlanRequestCredits.ts
@@ -372,31 +440,57 @@ model/subAccountUpdatePlanRequestFeatures.ts
model/subAccountsResponse.ts
model/subAccountsResponseSubAccountsInner.ts
model/subAccountsResponseSubAccountsInnerGroupsInner.ts
+model/subAccountsUpdatePlanRequest.ts
+model/subAccountsUpdatePlanRequestFeatures.ts
+model/subscription.ts
+model/subscriptionAggregateBalance.ts
+model/subscriptionAttributedReward.ts
+model/subscriptionBalances.ts
+model/subscriptionHandlerInfo.ts
+model/subscriptionMember.ts
+model/subscriptionTier.ts
model/task.ts
model/taskList.ts
model/taskReminder.ts
model/taskTypes.ts
+model/tier.ts
+model/tierAccessConditionsInner.ts
+model/tierForContact.ts
+model/tierGroup.ts
+model/tierGroupPage.ts
+model/tierRequest.ts
+model/tierRequestAccessConditionsInner.ts
+model/tierRequestPutPayload.ts
+model/tierRequestTierRewardsInner.ts
+model/tierTierRewardsInner.ts
+model/transaction.ts
+model/transactionHistory.ts
+model/transactionHistoryResp.ts
+model/unauthorizedResponse.ts
model/updateAttribute.ts
model/updateAttributeEnumerationInner.ts
+model/updateBalanceDefinitionPayload.ts
+model/updateBalanceLimitPayload.ts
model/updateBatchContacts.ts
model/updateBatchContactsContactsInner.ts
model/updateBatchContactsModel.ts
model/updateCampaignStatus.ts
-model/updateChild.ts
-model/updateChildAccountStatus.ts
-model/updateChildDomain.ts
model/updateContact.ts
model/updateCouponCollection200Response.ts
model/updateCouponCollectionRequest.ts
model/updateEmailCampaign.ts
+model/updateEmailCampaignEmailExpirationDate.ts
model/updateEmailCampaignRecipients.ts
model/updateEmailCampaignSender.ts
model/updateExternalFeed.ts
model/updateList.ts
+model/updateLoyaltyProgramPayload.ts
model/updateSender.ts
model/updateSmsCampaign.ts
model/updateSmtpTemplate.ts
model/updateSmtpTemplateSender.ts
+model/updateTierGroupRequest.ts
+model/updateUserResponse.ts
model/updateWebhook.ts
model/updateWhatsAppCampaign.ts
model/uploadImageModel.ts
@@ -404,5 +498,3 @@ model/uploadImageToGallery.ts
model/variablesItems.ts
model/whatsappCampStats.ts
model/whatsappCampTemplate.ts
-package.json
-tsconfig.json
diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION
index 3769235..5f84a81 100644
--- a/.openapi-generator/VERSION
+++ b/.openapi-generator/VERSION
@@ -1 +1 @@
-7.1.0
\ No newline at end of file
+7.12.0
diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION
deleted file mode 100644
index b0bea14..0000000
--- a/.swagger-codegen/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-2.4.32
\ No newline at end of file
diff --git a/LICENSE.md b/LICENSE.md
deleted file mode 100644
index b7c41f7..0000000
--- a/LICENSE.md
+++ /dev/null
@@ -1,15 +0,0 @@
-ISC License
-
-Copyright (c) 2023, Brevo
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/README.md b/README.md
deleted file mode 100644
index 374a9fc..0000000
--- a/README.md
+++ /dev/null
@@ -1,156 +0,0 @@
-# Brevo typescript
-
-Brevo's API v3 TypeScript-Node Library
-
-Brevo's API exposes the entire Brevo features via a standardized programmatic interface. Please refer to the full [documentation](https://developers.brevo.com) to learn more.
-
-This is the wrapper for the API. It implements all the features of the API v3. It supports promises.
-
-Brevo's API matches the [OpenAPI v2 definition](https://www.openapis.org/). The specification can be downloaded [here](https://api.brevo.com/v3/swagger_definition_v3.yml).
-
-## Installation
-
-### For [Node.js](https://nodejs.org/)
-
-#### npm
-
-The following recommended installation requires [npm](https://npmjs.org/). If you are unfamiliar with npm, see the [npm docs](https://npmjs.org/doc/).
-
-Then install it via:
-
-```shell
-npm i @getbrevo/brevo --save
-# or
-yarn add @getbrevo/brevo
-```
-
-## Getting Started
-
-
-
-# We have two options:
-- First example is where **typescript is not supported** i.e. [v1.0.1]([url](https://www.npmjs.com/package/@getbrevo/brevo/v/1.0.1))
-- Second example is where **typescript is supported** i.e. [v2.1.1]([url](https://www.npmjs.com/package/@getbrevo/brevo/v/2.1.1))
-
-
-```shell
--------------------------------------------------------------------------------------------------------------------------
----------------------------------------------- Typescript not supported v1.0.1 ---------------------------------------
--------------------------------------------------------------------------------------------------------------------------
-const brevo = require('@getbrevo/brevo');
-let defaultClient = brevo.ApiClient.instance;
-
-let apiKey = defaultClient.authentications['api-key'];
-apiKey.apiKey = 'YOUR API KEY';
-
-let apiInstance = new brevo.TransactionalEmailsApi();
-let sendSmtpEmail = new brevo.SendSmtpEmail();
-
-sendSmtpEmail.subject = "My {{params.subject}}";
-sendSmtpEmail.htmlContent = "
Common: This is my first transactional email {{params.parameter}}
";
-sendSmtpEmail.sender = { "name": "John", "email": "example@example.com" };
-sendSmtpEmail.to = [
- { "email": "example@brevo.com", "name": "sample-name" }
-];
-sendSmtpEmail.replyTo = { "email": "example@brevo.com", "name": "sample-name" };
-sendSmtpEmail.headers = { "Some-Custom-Name": "unique-id-1234" };
-sendSmtpEmail.params = { "parameter": "My param value", "subject": "common subject" };
-
-
-apiInstance.sendTransacEmail(sendSmtpEmail).then(function (data) {
- console.log('API called successfully. Returned data: ' + JSON.stringify(data));
-}, function (error) {
- console.error(error);
-});
-
-```
--------------------------------------------------------------------------------------------------------------------------
-## Typescript supported with version v2.1.1
-
-```shell
--------------------------------------------------------------------------------------------------------------------------
----------------------------------------------- Typescript supported with v2.1.1 --------------------------------------
--------------------------------------------------------------------------------------------------------------------------
-const brevo = require('@getbrevo/brevo');
-let apiInstance = new brevo.TransactionalEmailsApi();
-
-let apiKey = apiInstance.authentications['api-key'];
-apiKey.apiKey = 'YOUR API KEY';
-
-let sendSmtpEmail = new brevo.SendSmtpEmail();
-
-sendSmtpEmail.subject = "My {{params.subject}}";
-sendSmtpEmail.htmlContent = "Common: This is my first transactional email {{params.parameter}}
";
-sendSmtpEmail.sender = { "name": "John", "email": "shubham.upadhyay@sendinblue.com" };
-sendSmtpEmail.to = [
- { "email": "shubham.upadhyay@sendinblue.com", "name": "shubham upadhyay" }
-];
-sendSmtpEmail.replyTo = { "email": "shubham.upadhyay@sendinblue.com", "name": "Shubham Upadhyay" };
-sendSmtpEmail.headers = { "Some-Custom-Name": "unique-id-1234" };
-sendSmtpEmail.params = { "parameter": "My param value", "subject": "common subject" };
-
-
-apiInstance.sendTransacEmail(sendSmtpEmail).then(function (data) {
- console.log('API called successfully. Returned data: ' + JSON.stringify(data));
-}, function (error) {
- console.error(error);
-});
-
-```
--------------------------------------------------------------------------------------------------------------------------
-## Get Contact attributes API example:
-
-```shell
-const brevo = require('@getbrevo/brevo');
-
-let apiInstance = new brevo.ContactsApi()
-
-let apiKey = apiInstance.authentications['api-key'];
-apiKey.apiKey = 'YOUR API KEY';
-
-apiInstance.getAttributes().then(function(data) {
- console.log('API called successfully. Returned data: ' + JSON.stringify(data));
-
-}, function(error) {
- console.error(error);
-});
-
-```
--------------------------------------------------------------------------------------------------------------------------
-## Get Account API example:
-
-```shell
-const brevo = require('@getbrevo/brevo');
-
-let apiInstance = new brevo.AccountApi()
-
-let apiKey = apiInstance.authentications['api-key'];
-apiKey.apiKey = 'YOUR API KEY';
-
-apiInstance.getAccount().then(function(data) {
- console.log('API called successfully. Returned data: ' + JSON.stringify(data));
-
-}, function(error) {
- console.error(error);
-});
-
-```
--------------------------------------------------------------------------------------------------------------------------
-## Get Contacts API example:
-```shell
-const brevo = require('@getbrevo/brevo');
-
-let apiInstance = new brevo.ContactsApi()
-
-let apiKey = apiInstance.authentications['api-key'];
-apiKey.apiKey = 'YOUR API KEY';
-
-apiInstance.getContacts().then(function(data) {
- console.log('API called successfully. Returned data: ' + JSON.stringify(data));
-
-}, function(error) {
- console.error(error);
-});
-```
-
-For more examples, refer the [Endpoints Guide](https://developers.brevo.com/reference)
diff --git a/api/accountApi.ts b/api/accountApi.ts
index f82689c..eccf9e2 100644
--- a/api/accountApi.ts
+++ b/api/accountApi.ts
@@ -31,8 +31,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum AccountApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class AccountApi {
@@ -42,8 +41,7 @@ export class AccountApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -124,11 +122,8 @@ export class AccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -166,10 +161,11 @@ export class AccountApi {
* @summary Get user activity logs
* @param startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search.
* @param endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month.
+ * @param email Enter the user\'s email address to filter their activity in the account.
* @param limit Number of documents per page
* @param offset Index of the first document in the page.
*/
- public async getAccountActivity (startDate?: string, endDate?: string, limit?: number, offset?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetAccountActivity; }> {
+ public async getAccountActivity (startDate?: string, endDate?: string, email?: string, limit?: number, offset?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetAccountActivity; }> {
const localVarPath = this.basePath + '/organization/activities';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -190,6 +186,10 @@ export class AccountApi {
localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string");
}
+ if (email !== undefined) {
+ localVarQueryParameters['email'] = ObjectSerializer.serialize(email, "string");
+ }
+
if (limit !== undefined) {
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
}
@@ -212,11 +212,8 @@ export class AccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/apis.ts b/api/apis.ts
index f621d6a..eb407df 100644
--- a/api/apis.ts
+++ b/api/apis.ts
@@ -1,5 +1,7 @@
export * from './accountApi';
import { AccountApi } from './accountApi';
+export * from './balanceApi';
+import { BalanceApi } from './balanceApi';
export * from './companiesApi';
import { CompaniesApi } from './companiesApi';
export * from './contactsApi';
@@ -16,8 +18,8 @@ export * from './ecommerceApi';
import { EcommerceApi } from './ecommerceApi';
export * from './emailCampaignsApi';
import { EmailCampaignsApi } from './emailCampaignsApi';
-export * from './eventsApi';
-import { EventsApi } from './eventsApi';
+export * from './eventApi';
+import { EventApi } from './eventApi';
export * from './externalFeedsApi';
import { ExternalFeedsApi } from './externalFeedsApi';
export * from './filesApi';
@@ -32,14 +34,18 @@ export * from './paymentsApi';
import { PaymentsApi } from './paymentsApi';
export * from './processApi';
import { ProcessApi } from './processApi';
-export * from './resellerApi';
-import { ResellerApi } from './resellerApi';
+export * from './programApi';
+import { ProgramApi } from './programApi';
+export * from './rewardApi';
+import { RewardApi } from './rewardApi';
export * from './sMSCampaignsApi';
import { SMSCampaignsApi } from './sMSCampaignsApi';
export * from './sendersApi';
import { SendersApi } from './sendersApi';
export * from './tasksApi';
import { TasksApi } from './tasksApi';
+export * from './tierApi';
+import { TierApi } from './tierApi';
export * from './transactionalEmailsApi';
import { TransactionalEmailsApi } from './transactionalEmailsApi';
export * from './transactionalSMSApi';
@@ -63,4 +69,4 @@ export class HttpError extends Error {
export { RequestFile } from '../model/models';
-export const APIS = [AccountApi, CompaniesApi, ContactsApi, ConversationsApi, CouponsApi, DealsApi, DomainsApi, EcommerceApi, EmailCampaignsApi, EventsApi, ExternalFeedsApi, FilesApi, InboundParsingApi, MasterAccountApi, NotesApi, PaymentsApi, ProcessApi, ResellerApi, SMSCampaignsApi, SendersApi, TasksApi, TransactionalEmailsApi, TransactionalSMSApi, TransactionalWhatsAppApi, UserApi, WebhooksApi, WhatsAppCampaignsApi];
+export const APIS = [AccountApi, BalanceApi, CompaniesApi, ContactsApi, ConversationsApi, CouponsApi, DealsApi, DomainsApi, EcommerceApi, EmailCampaignsApi, EventApi, ExternalFeedsApi, FilesApi, InboundParsingApi, MasterAccountApi, NotesApi, PaymentsApi, ProcessApi, ProgramApi, RewardApi, SMSCampaignsApi, SendersApi, TasksApi, TierApi, TransactionalEmailsApi, TransactionalSMSApi, TransactionalWhatsAppApi, UserApi, WebhooksApi, WhatsAppCampaignsApi];
diff --git a/api/resellerApi.ts b/api/balanceApi.ts
similarity index 53%
rename from api/resellerApi.ts
rename to api/balanceApi.ts
index ffdae1d..078be11 100644
--- a/api/resellerApi.ts
+++ b/api/balanceApi.ts
@@ -15,22 +15,23 @@ import localVarRequest from 'request';
import http from 'http';
/* tslint:disable:no-unused-locals */
-import { AddChildDomain } from '../model/addChildDomain';
-import { AddCredits } from '../model/addCredits';
-import { CreateChild } from '../model/createChild';
-import { CreateReseller } from '../model/createReseller';
-import { ErrorModel } from '../model/errorModel';
-import { GetChildAccountCreationStatus } from '../model/getChildAccountCreationStatus';
-import { GetChildDomain } from '../model/getChildDomain';
-import { GetChildInfo } from '../model/getChildInfo';
-import { GetChildrenList } from '../model/getChildrenList';
-import { GetSsoToken } from '../model/getSsoToken';
-import { ManageIp } from '../model/manageIp';
-import { RemainingCreditModel } from '../model/remainingCreditModel';
-import { RemoveCredits } from '../model/removeCredits';
-import { UpdateChild } from '../model/updateChild';
-import { UpdateChildAccountStatus } from '../model/updateChildAccountStatus';
-import { UpdateChildDomain } from '../model/updateChildDomain';
+import { Balance } from '../model/balance';
+import { BalanceDefinition } from '../model/balanceDefinition';
+import { BalanceDefinitionPage } from '../model/balanceDefinitionPage';
+import { BalanceLimit } from '../model/balanceLimit';
+import { BalanceOrder } from '../model/balanceOrder';
+import { ContactBalancesResp } from '../model/contactBalancesResp';
+import { CreateBalanceDefinitionPayload } from '../model/createBalanceDefinitionPayload';
+import { CreateBalanceLimitPayload } from '../model/createBalanceLimitPayload';
+import { CreateBalancePayload } from '../model/createBalancePayload';
+import { CreateOrderPayload } from '../model/createOrderPayload';
+import { CreateTransactionPayload } from '../model/createTransactionPayload';
+import { ErrorResponse } from '../model/errorResponse';
+import { ModelSubscriptionBalanceResp } from '../model/modelSubscriptionBalanceResp';
+import { Transaction } from '../model/transaction';
+import { TransactionHistoryResp } from '../model/transactionHistoryResp';
+import { UpdateBalanceDefinitionPayload } from '../model/updateBalanceDefinitionPayload';
+import { UpdateBalanceLimitPayload } from '../model/updateBalanceLimitPayload';
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
@@ -43,20 +44,18 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// This file is autogenerated - Please do not edit
// ===============================================
-export enum ResellerApiApiKeys {
- apiKey,
- partnerKey,
+export enum BalanceApiApiKeys {
+ api-key,
}
-export class ResellerApi {
+export class BalanceApi {
protected _basePath = defaultBasePath;
protected _defaultHeaders : any = {};
protected _useQuerystring : boolean = false;
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -98,8 +97,8 @@ export class ResellerApi {
this.authentications.default = auth;
}
- public setApiKey(key: ResellerApiApiKeys, value: string) {
- (this.authentications as any)[ResellerApiApiKeys[key]].apiKey = value;
+ public setApiKey(key: BalanceApiApiKeys, value: string) {
+ (this.authentications as any)[BalanceApiApiKeys[key]].apiKey = value;
}
public addInterceptor(interceptor: Interceptor) {
@@ -107,14 +106,14 @@ export class ResellerApi {
}
/**
- *
- * @summary Add Email and/or SMS credits to a specific child account
- * @param childIdentifier Either auth key or id of reseller\'s child
- * @param addCredits Values to post to add credit to a specific child account
+ * Creates new transaction and returns information
+ * @summary Create new transaction
+ * @param pid Loyalty Program Id
+ * @param createTransactionPayload Transaction Payload
*/
- public async addCredits (childIdentifier: string, addCredits: AddCredits, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/credits/add'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async beginTransaction (pid: string, createTransactionPayload: CreateTransactionPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Transaction; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/transactions'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -126,14 +125,14 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling addCredits.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling beginTransaction.');
}
- // verify required parameter 'addCredits' is not null or undefined
- if (addCredits === null || addCredits === undefined) {
- throw new Error('Required parameter addCredits was null or undefined when calling addCredits.');
+ // verify required parameter 'createTransactionPayload' is not null or undefined
+ if (createTransactionPayload === null || createTransactionPayload === undefined) {
+ throw new Error('Required parameter createTransactionPayload was null or undefined when calling beginTransaction.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -147,15 +146,12 @@ export class ResellerApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(addCredits, "AddCredits")
+ body: ObjectSerializer.serialize(createTransactionPayload, "CreateTransactionPayload")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -172,13 +168,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: Transaction; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- body = ObjectSerializer.deserialize(body, "RemainingCreditModel");
+ body = ObjectSerializer.deserialize(body, "Transaction");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -189,14 +185,15 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Associate a dedicated IP to the child
- * @param childIdentifier Either auth key or id of reseller\'s child
- * @param ip IP to associate
+ * Cancels transaction
+ * @summary Cancel transaction
+ * @param pid Loyalty Program Id
+ * @param tid Transaction Id
*/
- public async associateIpToChild (childIdentifier: string, ip: ManageIp, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/ips/associate'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async cancelTransaction (pid: string, tid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Transaction; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/transactions/{tid}/cancel'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'tid' + '}', encodeURIComponent(String(tid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -208,14 +205,14 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling associateIpToChild.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling cancelTransaction.');
}
- // verify required parameter 'ip' is not null or undefined
- if (ip === null || ip === undefined) {
- throw new Error('Required parameter ip was null or undefined when calling associateIpToChild.');
+ // verify required parameter 'tid' is not null or undefined
+ if (tid === null || tid === undefined) {
+ throw new Error('Required parameter tid was null or undefined when calling cancelTransaction.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -229,15 +226,11 @@ export class ResellerApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(ip, "ManageIp")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -254,12 +247,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: Transaction; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "Transaction");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -270,14 +264,15 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Create a domain for a child account
- * @param childIdentifier Either auth key or id of reseller\'s child
- * @param addChildDomain Sender domain to add for a specific child account. This will not be displayed to the parent account.
+ * Completes transaction
+ * @summary Complete transaction
+ * @param pid Loyalty Program Id
+ * @param tid Transaction Id
*/
- public async createChildDomain (childIdentifier: string, addChildDomain: AddChildDomain, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async completeTransaction (pid: string, tid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Transaction; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/transactions/{tid}/complete'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'tid' + '}', encodeURIComponent(String(tid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -289,14 +284,14 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling createChildDomain.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling completeTransaction.');
}
- // verify required parameter 'addChildDomain' is not null or undefined
- if (addChildDomain === null || addChildDomain === undefined) {
- throw new Error('Required parameter addChildDomain was null or undefined when calling createChildDomain.');
+ // verify required parameter 'tid' is not null or undefined
+ if (tid === null || tid === undefined) {
+ throw new Error('Required parameter tid was null or undefined when calling completeTransaction.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -310,15 +305,11 @@ export class ResellerApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(addChildDomain, "AddChildDomain")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -335,12 +326,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: Transaction; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "Transaction");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -351,12 +343,16 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Creates a reseller child
- * @param resellerChild reseller child to add
+ * Creates balance limit and sends the created UUID along with the data
+ * @summary Create balance limits
+ * @param pid Loyalty Program Id
+ * @param bdid Balance Definition Id
+ * @param createBalanceLimitPayload Balance Definition Payload
*/
- public async createResellerChild (resellerChild?: CreateChild, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateReseller; }> {
- const localVarPath = this.basePath + '/reseller/children';
+ public async createBalanceLimit (pid: string, bdid: string, createBalanceLimitPayload: CreateBalanceLimitPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceLimit; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -368,6 +364,21 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling createBalanceLimit.');
+ }
+
+ // verify required parameter 'bdid' is not null or undefined
+ if (bdid === null || bdid === undefined) {
+ throw new Error('Required parameter bdid was null or undefined when calling createBalanceLimit.');
+ }
+
+ // verify required parameter 'createBalanceLimitPayload' is not null or undefined
+ if (createBalanceLimitPayload === null || createBalanceLimitPayload === undefined) {
+ throw new Error('Required parameter createBalanceLimitPayload was null or undefined when calling createBalanceLimit.');
+ }
+
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -379,15 +390,91 @@ export class ResellerApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(resellerChild, "CreateChild")
+ body: ObjectSerializer.serialize(createBalanceLimitPayload, "CreateBalanceLimitPayload")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: BalanceLimit; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "BalanceLimit");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Returns created order
+ * @summary Create balance order
+ * @param pid Loyalty Program Id
+ * @param createOrderPayload Order Payload
+ */
+ public async createBalanceOrder (pid: string, createOrderPayload: CreateOrderPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceOrder; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/create-order'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling createBalanceOrder.');
+ }
+
+ // verify required parameter 'createOrderPayload' is not null or undefined
+ if (createOrderPayload === null || createOrderPayload === undefined) {
+ throw new Error('Required parameter createOrderPayload was null or undefined when calling createBalanceOrder.');
}
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(createOrderPayload, "CreateOrderPayload")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -404,13 +491,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body: CreateReseller; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: BalanceOrder; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- body = ObjectSerializer.deserialize(body, "CreateReseller");
+ body = ObjectSerializer.deserialize(body, "BalanceOrder");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -421,15 +508,15 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Delete the sender domain of the reseller child based on the childIdentifier and domainName passed
- * @param childIdentifier Either auth key or id of reseller\'s child
- * @param domainName Pass the existing domain that needs to be deleted
+ * Delete Balance definition
+ * @summary Delete balance definition
+ * @param pid Loyalty Program Id
+ * @param bdid Balance Definition Id
*/
- public async deleteChildDomain (childIdentifier: string, domainName: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains/{domainName}'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)))
- .replace('{' + 'domainName' + '}', encodeURIComponent(String(domainName)));
+ public async deleteBalanceDefinition (pid: string, bdid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -441,14 +528,14 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling deleteChildDomain.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling deleteBalanceDefinition.');
}
- // verify required parameter 'domainName' is not null or undefined
- if (domainName === null || domainName === undefined) {
- throw new Error('Required parameter domainName was null or undefined when calling deleteChildDomain.');
+ // verify required parameter 'bdid' is not null or undefined
+ if (bdid === null || bdid === undefined) {
+ throw new Error('Required parameter bdid was null or undefined when calling deleteBalanceDefinition.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -465,11 +552,8 @@ export class ResellerApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -502,13 +586,17 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Delete a single reseller child based on the child identifier supplied
- * @param childIdentifier Either auth key or child id of reseller\'s child
+ * Delete balance limit
+ * @summary Delete balance limit
+ * @param pid Loyalty Program Id
+ * @param bdid Balance Definition Id
+ * @param blid Balance Limit Id
*/
- public async deleteResellerChild (childIdentifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async deleteBalanceLimit (pid: string, bdid: string, blid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)))
+ .replace('{' + 'blid' + '}', encodeURIComponent(String(blid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -520,9 +608,19 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling deleteResellerChild.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling deleteBalanceLimit.');
+ }
+
+ // verify required parameter 'bdid' is not null or undefined
+ if (bdid === null || bdid === undefined) {
+ throw new Error('Required parameter bdid was null or undefined when calling deleteBalanceLimit.');
+ }
+
+ // verify required parameter 'blid' is not null or undefined
+ if (blid === null || blid === undefined) {
+ throw new Error('Required parameter blid was null or undefined when calling deleteBalanceLimit.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -539,11 +637,8 @@ export class ResellerApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -576,14 +671,16 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Dissociate a dedicated IP to the child
- * @param childIdentifier Either auth key or id of reseller\'s child
- * @param ip IP to dissociate
+ * Returns balance definition
+ * @summary Get balance definition
+ * @param pid Loyalty Program Id
+ * @param bdid Balance Definition Id
+ * @param version Version
*/
- public async dissociateIpFromChild (childIdentifier: string, ip: ManageIp, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/ips/dissociate'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async getBalanceDefinition (pid: string, bdid: string, version?: 'active' | 'draft', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -595,14 +692,18 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling dissociateIpFromChild.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling getBalanceDefinition.');
+ }
+
+ // verify required parameter 'bdid' is not null or undefined
+ if (bdid === null || bdid === undefined) {
+ throw new Error('Required parameter bdid was null or undefined when calling getBalanceDefinition.');
}
- // verify required parameter 'ip' is not null or undefined
- if (ip === null || ip === undefined) {
- throw new Error('Required parameter ip was null or undefined when calling dissociateIpFromChild.');
+ if (version !== undefined) {
+ localVarQueryParameters['version'] = ObjectSerializer.serialize(version, "'active' | 'draft'");
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -610,21 +711,17 @@ export class ResellerApi {
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
- method: 'POST',
+ method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(ip, "ManageIp")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -641,12 +738,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "BalanceDefinition");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -657,13 +755,18 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Get the status of a reseller\'s child account creation, whether it is successfully created (exists) or not based on the identifier supplied
- * @param childIdentifier Either auth key or id of reseller\'s child
+ * Returns balance definition page
+ * @summary Get balance definition list
+ * @param pid Loyalty Program Id
+ * @param limit Limit the number of records returned
+ * @param offset Offset to paginate records
+ * @param sortField Field to sort by
+ * @param sort Sort direction
+ * @param version Version
*/
- public async getChildAccountCreationStatus (childIdentifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetChildAccountCreationStatus; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/accountCreationStatus'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async getBalanceDefinitionList (pid: string, limit?: number, offset?: number, sortField?: 'name' | 'created_at' | 'updated_at', sort?: 'asc' | 'desc', version?: 'active' | 'draft', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceDefinitionPage; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -675,9 +778,29 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling getChildAccountCreationStatus.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling getBalanceDefinitionList.');
+ }
+
+ if (limit !== undefined) {
+ localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
+ }
+
+ if (offset !== undefined) {
+ localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number");
+ }
+
+ if (sortField !== undefined) {
+ localVarQueryParameters['sortField'] = ObjectSerializer.serialize(sortField, "'name' | 'created_at' | 'updated_at'");
+ }
+
+ if (sort !== undefined) {
+ localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'");
+ }
+
+ if (version !== undefined) {
+ localVarQueryParameters['version'] = ObjectSerializer.serialize(version, "'active' | 'draft'");
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -694,11 +817,8 @@ export class ResellerApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -715,13 +835,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body: GetChildAccountCreationStatus; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: BalanceDefinitionPage; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- body = ObjectSerializer.deserialize(body, "GetChildAccountCreationStatus");
+ body = ObjectSerializer.deserialize(body, "BalanceDefinitionPage");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -732,13 +852,18 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Get all sender domains for a specific child account
- * @param childIdentifier Either auth key or id of reseller\'s child
+ * Fetches balance limits and send the created UUID along with the data
+ * @summary Get balance limits
+ * @param pid Loyalty Program Id
+ * @param bdid Balance Definition Id
+ * @param blid Balance Limit Id
+ * @param version Version
*/
- public async getChildDomains (childIdentifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async getBalanceLimit (pid: string, bdid: string, blid: string, version?: 'active' | 'draft', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceLimit; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)))
+ .replace('{' + 'blid' + '}', encodeURIComponent(String(blid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -750,9 +875,23 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling getChildDomains.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling getBalanceLimit.');
+ }
+
+ // verify required parameter 'bdid' is not null or undefined
+ if (bdid === null || bdid === undefined) {
+ throw new Error('Required parameter bdid was null or undefined when calling getBalanceLimit.');
+ }
+
+ // verify required parameter 'blid' is not null or undefined
+ if (blid === null || blid === undefined) {
+ throw new Error('Required parameter blid was null or undefined when calling getBalanceLimit.');
+ }
+
+ if (version !== undefined) {
+ localVarQueryParameters['version'] = ObjectSerializer.serialize(version, "'active' | 'draft'");
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -769,11 +908,8 @@ export class ResellerApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -790,13 +926,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: BalanceLimit; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- body = ObjectSerializer.deserialize(body, "Array");
+ body = ObjectSerializer.deserialize(body, "BalanceLimit");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -807,13 +943,13 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Get a child account\'s details
- * @param childIdentifier Either auth key or id of reseller\'s child
+ * Returns balance list
+ * @summary Get balance list
+ * @param pid Loyalty Program Id
*/
- public async getChildInfo (childIdentifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetChildInfo; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async getContactBalances (pid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ContactBalancesResp; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/contact-balances'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -825,9 +961,9 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling getChildInfo.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling getContactBalances.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -844,11 +980,87 @@ export class ResellerApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: ContactBalancesResp; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "ContactBalancesResp");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Returns subscription balances
+ * @summary Get subscription balances
+ * @param cid Contact Id
+ * @param pid Loyalty Program Id
+ */
+ public async getSubscriptionBalances (cid: number, pid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ModelSubscriptionBalanceResp; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/subscriptions/{cid}/balances'
+ .replace('{' + 'cid' + '}', encodeURIComponent(String(cid)))
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'cid' is not null or undefined
+ if (cid === null || cid === undefined) {
+ throw new Error('Required parameter cid was null or undefined when calling getSubscriptionBalances.');
+ }
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling getSubscriptionBalances.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'GET',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -865,13 +1077,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body: GetChildInfo; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: ModelSubscriptionBalanceResp; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- body = ObjectSerializer.deserialize(body, "GetChildInfo");
+ body = ObjectSerializer.deserialize(body, "ModelSubscriptionBalanceResp");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -882,13 +1094,19 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Get the list of all children accounts
- * @param limit Number of documents for child accounts information per page
- * @param offset Index of the first document in the page
+ * Returns Active Balances
+ * @summary Get Active Balances API
+ * @param pid Loyalty Program Id
+ * @param contactId Contact ID
+ * @param balanceDefinitionId Balance Definition ID
+ * @param limit Limit
+ * @param offset Offset
+ * @param sortField Sort Field
+ * @param sort Sort Order
*/
- public async getResellerChilds (limit?: number, offset?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetChildrenList; }> {
- const localVarPath = this.basePath + '/reseller/children';
+ public async loyaltyBalanceProgramsPidActiveBalanceGet (pid: string, contactId: number, balanceDefinitionId: string, limit?: number, offset?: number, sortField?: string, sort?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceLimit; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/active-balance'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -900,6 +1118,21 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling loyaltyBalanceProgramsPidActiveBalanceGet.');
+ }
+
+ // verify required parameter 'contactId' is not null or undefined
+ if (contactId === null || contactId === undefined) {
+ throw new Error('Required parameter contactId was null or undefined when calling loyaltyBalanceProgramsPidActiveBalanceGet.');
+ }
+
+ // verify required parameter 'balanceDefinitionId' is not null or undefined
+ if (balanceDefinitionId === null || balanceDefinitionId === undefined) {
+ throw new Error('Required parameter balanceDefinitionId was null or undefined when calling loyaltyBalanceProgramsPidActiveBalanceGet.');
+ }
+
if (limit !== undefined) {
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
}
@@ -908,6 +1141,22 @@ export class ResellerApi {
localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number");
}
+ if (sortField !== undefined) {
+ localVarQueryParameters['sort_field'] = ObjectSerializer.serialize(sortField, "string");
+ }
+
+ if (sort !== undefined) {
+ localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "string");
+ }
+
+ if (contactId !== undefined) {
+ localVarQueryParameters['contact_id'] = ObjectSerializer.serialize(contactId, "number");
+ }
+
+ if (balanceDefinitionId !== undefined) {
+ localVarQueryParameters['balance_definition_id'] = ObjectSerializer.serialize(balanceDefinitionId, "string");
+ }
+
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -922,11 +1171,8 @@ export class ResellerApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -943,13 +1189,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body: GetChildrenList; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: BalanceLimit; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- body = ObjectSerializer.deserialize(body, "GetChildrenList");
+ body = ObjectSerializer.deserialize(body, "BalanceLimit");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -960,13 +1206,14 @@ export class ResellerApi {
});
}
/**
- * It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token]
- * @summary Get session token to access Brevo (SSO)
- * @param childIdentifier Either auth key or id of reseller\'s child
+ * Creates balance definition and returns information
+ * @summary Create balance definition
+ * @param pid Loyalty Program Id
+ * @param createBalanceDefinitionPayload Create Balance Definition Payload
*/
- public async getSsoToken (childIdentifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/auth'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async loyaltyBalanceProgramsPidBalanceDefinitionsPost (pid: string, createBalanceDefinitionPayload: CreateBalanceDefinitionPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -978,9 +1225,14 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling getSsoToken.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling loyaltyBalanceProgramsPidBalanceDefinitionsPost.');
+ }
+
+ // verify required parameter 'createBalanceDefinitionPayload' is not null or undefined
+ if (createBalanceDefinitionPayload === null || createBalanceDefinitionPayload === undefined) {
+ throw new Error('Required parameter createBalanceDefinitionPayload was null or undefined when calling loyaltyBalanceProgramsPidBalanceDefinitionsPost.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -988,20 +1240,18 @@ export class ResellerApi {
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
+ method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
+ body: ObjectSerializer.serialize(createBalanceDefinitionPayload, "CreateBalanceDefinitionPayload")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1018,13 +1268,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body: GetSsoToken; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- body = ObjectSerializer.deserialize(body, "GetSsoToken");
+ body = ObjectSerializer.deserialize(body, "BalanceDefinition");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -1035,14 +1285,16 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Remove Email and/or SMS credits from a specific child account
- * @param childIdentifier Either auth key or id of reseller\'s child
- * @param removeCredits Values to post to remove email or SMS credits from a specific child account
+ * Creates a balance for a contact
+ * @summary Create subscription balances
+ * @param pid Loyalty Program Id
+ * @param cid Contact Id
+ * @param createBalancePayload Create Balnce Payload
*/
- public async removeCredits (childIdentifier: string, removeCredits: RemoveCredits, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/credits/remove'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async loyaltyBalanceProgramsPidSubscriptionsCidBalancesPost (pid: string, cid: string, createBalancePayload: CreateBalancePayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Balance; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/subscriptions/{cid}/balances'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'cid' + '}', encodeURIComponent(String(cid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -1054,14 +1306,19 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling removeCredits.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling loyaltyBalanceProgramsPidSubscriptionsCidBalancesPost.');
+ }
+
+ // verify required parameter 'cid' is not null or undefined
+ if (cid === null || cid === undefined) {
+ throw new Error('Required parameter cid was null or undefined when calling loyaltyBalanceProgramsPidSubscriptionsCidBalancesPost.');
}
- // verify required parameter 'removeCredits' is not null or undefined
- if (removeCredits === null || removeCredits === undefined) {
- throw new Error('Required parameter removeCredits was null or undefined when calling removeCredits.');
+ // verify required parameter 'createBalancePayload' is not null or undefined
+ if (createBalancePayload === null || createBalancePayload === undefined) {
+ throw new Error('Required parameter createBalancePayload was null or undefined when calling loyaltyBalanceProgramsPidSubscriptionsCidBalancesPost.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -1075,15 +1332,12 @@ export class ResellerApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(removeCredits, "RemoveCredits")
+ body: ObjectSerializer.serialize(createBalancePayload, "CreateBalancePayload")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1100,13 +1354,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body: RemainingCreditModel; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: Balance; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- body = ObjectSerializer.deserialize(body, "RemainingCreditModel");
+ body = ObjectSerializer.deserialize(body, "Balance");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -1117,14 +1371,20 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Update info of reseller\'s child account status based on the childIdentifier supplied
- * @param childIdentifier Either auth key or id of reseller\'s child
- * @param updateChildAccountStatus values to update in child account status
+ * Returns transaction history
+ * @summary Get Transaction History API
+ * @param pid Loyalty Program Id
+ * @param contactId Contact ID
+ * @param balanceDefinitionId Balance Definition ID
+ * @param limit Limit the number of records returned
+ * @param offset Skip a number of records
+ * @param sortField Field to sort by
+ * @param sort Sort order, either asc or desc
+ * @param filters Filters to apply
*/
- public async updateChildAccountStatus (childIdentifier: string, updateChildAccountStatus: UpdateChildAccountStatus, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/accountStatus'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async loyaltyBalanceProgramsPidTransactionHistoryGet (pid: string, contactId: number, balanceDefinitionId: string, limit?: number, offset?: number, sortField?: 'name' | 'created_at' | 'updated_at', sort?: 'asc' | 'desc', filters?: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: TransactionHistoryResp; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/transaction-history'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -1136,14 +1396,47 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling updateChildAccountStatus.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling loyaltyBalanceProgramsPidTransactionHistoryGet.');
+ }
+
+ // verify required parameter 'contactId' is not null or undefined
+ if (contactId === null || contactId === undefined) {
+ throw new Error('Required parameter contactId was null or undefined when calling loyaltyBalanceProgramsPidTransactionHistoryGet.');
}
- // verify required parameter 'updateChildAccountStatus' is not null or undefined
- if (updateChildAccountStatus === null || updateChildAccountStatus === undefined) {
- throw new Error('Required parameter updateChildAccountStatus was null or undefined when calling updateChildAccountStatus.');
+ // verify required parameter 'balanceDefinitionId' is not null or undefined
+ if (balanceDefinitionId === null || balanceDefinitionId === undefined) {
+ throw new Error('Required parameter balanceDefinitionId was null or undefined when calling loyaltyBalanceProgramsPidTransactionHistoryGet.');
+ }
+
+ if (limit !== undefined) {
+ localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
+ }
+
+ if (offset !== undefined) {
+ localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number");
+ }
+
+ if (sortField !== undefined) {
+ localVarQueryParameters['sort_field'] = ObjectSerializer.serialize(sortField, "'name' | 'created_at' | 'updated_at'");
+ }
+
+ if (sort !== undefined) {
+ localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'");
+ }
+
+ if (contactId !== undefined) {
+ localVarQueryParameters['contact_id'] = ObjectSerializer.serialize(contactId, "number");
+ }
+
+ if (balanceDefinitionId !== undefined) {
+ localVarQueryParameters['balance_definition_id'] = ObjectSerializer.serialize(balanceDefinitionId, "string");
+ }
+
+ if (filters !== undefined) {
+ localVarQueryParameters['filters'] = ObjectSerializer.serialize(filters, "Array");
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -1151,21 +1444,17 @@ export class ResellerApi {
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
- method: 'PUT',
+ method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(updateChildAccountStatus, "UpdateChildAccountStatus")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1182,12 +1471,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: TransactionHistoryResp; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "TransactionHistoryResp");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -1198,16 +1488,16 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Update the sender domain of reseller\'s child based on the childIdentifier and domainName passed
- * @param childIdentifier Either auth key or id of reseller\'s child
- * @param domainName Pass the existing domain that needs to be updated
- * @param updateChildDomain value to update for sender domain
+ * Updates Balance definition
+ * @summary Update balance definition
+ * @param pid Loyalty Program Id
+ * @param bdid Balance Definition Id
+ * @param updateBalanceDefinitionPayload Create Balance Definition Payload
*/
- public async updateChildDomain (childIdentifier: string, domainName: string, updateChildDomain: UpdateChildDomain, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}/domains/{domainName}'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)))
- .replace('{' + 'domainName' + '}', encodeURIComponent(String(domainName)));
+ public async updateBalanceDefinition (pid: string, bdid: string, updateBalanceDefinitionPayload: UpdateBalanceDefinitionPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -1219,19 +1509,19 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling updateChildDomain.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling updateBalanceDefinition.');
}
- // verify required parameter 'domainName' is not null or undefined
- if (domainName === null || domainName === undefined) {
- throw new Error('Required parameter domainName was null or undefined when calling updateChildDomain.');
+ // verify required parameter 'bdid' is not null or undefined
+ if (bdid === null || bdid === undefined) {
+ throw new Error('Required parameter bdid was null or undefined when calling updateBalanceDefinition.');
}
- // verify required parameter 'updateChildDomain' is not null or undefined
- if (updateChildDomain === null || updateChildDomain === undefined) {
- throw new Error('Required parameter updateChildDomain was null or undefined when calling updateChildDomain.');
+ // verify required parameter 'updateBalanceDefinitionPayload' is not null or undefined
+ if (updateBalanceDefinitionPayload === null || updateBalanceDefinitionPayload === undefined) {
+ throw new Error('Required parameter updateBalanceDefinitionPayload was null or undefined when calling updateBalanceDefinition.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -1245,15 +1535,12 @@ export class ResellerApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(updateChildDomain, "UpdateChildDomain")
+ body: ObjectSerializer.serialize(updateBalanceDefinitionPayload, "UpdateBalanceDefinitionPayload")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1270,12 +1557,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: BalanceDefinition; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "BalanceDefinition");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -1286,14 +1574,18 @@ export class ResellerApi {
});
}
/**
- *
- * @summary Update info of reseller\'s child based on the child identifier supplied
- * @param childIdentifier Either auth key or id of reseller\'s child
- * @param resellerChild values to update in child profile
+ * Updates balance limit
+ * @summary Updates balance limit
+ * @param pid Loyalty Program Id
+ * @param bdid Balance Definition Id
+ * @param blid Balance Limit Id
+ * @param updateBalanceLimitPayload Balance Limits Payload
*/
- public async updateResellerChild (childIdentifier: string, resellerChild: UpdateChild, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
- const localVarPath = this.basePath + '/reseller/children/{childIdentifier}'
- .replace('{' + 'childIdentifier' + '}', encodeURIComponent(String(childIdentifier)));
+ public async updateBalanceLimit (pid: string, bdid: string, blid: string, updateBalanceLimitPayload: UpdateBalanceLimitPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: BalanceLimit; }> {
+ const localVarPath = this.basePath + '/loyalty/balance/programs/{pid}/balance-definitions/{bdid}/limits/{blid}'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'bdid' + '}', encodeURIComponent(String(bdid)))
+ .replace('{' + 'blid' + '}', encodeURIComponent(String(blid)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
const produces = ['application/json'];
@@ -1305,14 +1597,24 @@ export class ResellerApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'childIdentifier' is not null or undefined
- if (childIdentifier === null || childIdentifier === undefined) {
- throw new Error('Required parameter childIdentifier was null or undefined when calling updateResellerChild.');
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling updateBalanceLimit.');
}
- // verify required parameter 'resellerChild' is not null or undefined
- if (resellerChild === null || resellerChild === undefined) {
- throw new Error('Required parameter resellerChild was null or undefined when calling updateResellerChild.');
+ // verify required parameter 'bdid' is not null or undefined
+ if (bdid === null || bdid === undefined) {
+ throw new Error('Required parameter bdid was null or undefined when calling updateBalanceLimit.');
+ }
+
+ // verify required parameter 'blid' is not null or undefined
+ if (blid === null || blid === undefined) {
+ throw new Error('Required parameter blid was null or undefined when calling updateBalanceLimit.');
+ }
+
+ // verify required parameter 'updateBalanceLimitPayload' is not null or undefined
+ if (updateBalanceLimitPayload === null || updateBalanceLimitPayload === undefined) {
+ throw new Error('Required parameter updateBalanceLimitPayload was null or undefined when calling updateBalanceLimit.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -1326,15 +1628,12 @@ export class ResellerApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(resellerChild, "UpdateChild")
+ body: ObjectSerializer.serialize(updateBalanceLimitPayload, "UpdateBalanceLimitPayload")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1351,12 +1650,13 @@ export class ResellerApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: BalanceLimit; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "BalanceLimit");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
diff --git a/api/companiesApi.ts b/api/companiesApi.ts
index 4127080..34264c8 100644
--- a/api/companiesApi.ts
+++ b/api/companiesApi.ts
@@ -16,12 +16,16 @@ import http from 'http';
/* tslint:disable:no-unused-locals */
import { CompaniesIdPatchRequest } from '../model/companiesIdPatchRequest';
+import { CompaniesImportPost200Response } from '../model/companiesImportPost200Response';
+import { CompaniesImportPost400Response } from '../model/companiesImportPost400Response';
import { CompaniesLinkUnlinkIdPatchRequest } from '../model/companiesLinkUnlinkIdPatchRequest';
import { CompaniesList } from '../model/companiesList';
import { CompaniesPost200Response } from '../model/companiesPost200Response';
import { CompaniesPostRequest } from '../model/companiesPostRequest';
import { Company } from '../model/company';
import { CompanyAttributesInner } from '../model/companyAttributesInner';
+import { CrmAttributesPost200Response } from '../model/crmAttributesPost200Response';
+import { CrmAttributesPostRequest } from '../model/crmAttributesPostRequest';
import { ErrorModel } from '../model/errorModel';
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
@@ -36,8 +40,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum CompaniesApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class CompaniesApi {
@@ -47,8 +50,7 @@ export class CompaniesApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -100,88 +102,22 @@ export class CompaniesApi {
/**
*
- * @summary Get company attributes
- */
- public async companiesAttributesGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> {
- const localVarPath = this.basePath + '/companies/attributes';
- let localVarQueryParameters: any = {};
- let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json'];
- // give precedence to 'application/json'
- if (produces.indexOf('application/json') >= 0) {
- localVarHeaderParams.Accept = 'application/json';
- } else {
- localVarHeaderParams.Accept = produces.join(',');
- }
- let localVarFormParams: any = {};
-
- (Object).assign(localVarHeaderParams, options.headers);
-
- let localVarUseFormData = false;
-
- let localVarRequestOptions: localVarRequest.Options = {
- method: 'GET',
- qs: localVarQueryParameters,
- headers: localVarHeaderParams,
- uri: localVarPath,
- useQuerystring: this._useQuerystring,
- json: true,
- };
-
- let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
- }
- authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
-
- let interceptorPromise = authenticationPromise;
- for (const interceptor of this.interceptors) {
- interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
- }
-
- return interceptorPromise.then(() => {
- if (Object.keys(localVarFormParams).length) {
- if (localVarUseFormData) {
- (localVarRequestOptions).formData = localVarFormParams;
- } else {
- localVarRequestOptions.form = localVarFormParams;
- }
- }
- return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => {
- localVarRequest(localVarRequestOptions, (error, response, body) => {
- if (error) {
- reject(error);
- } else {
- if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- body = ObjectSerializer.deserialize(body, "Array");
- resolve({ response: response, body: body });
- } else {
- reject(new HttpError(response, body, response.statusCode));
- }
- }
- });
- });
- });
- }
- /**
- *
- * @summary Get all companies
- * @param filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"5b1a17d914b73d35a76ca0c7\"}
+ * @summary Get all Companies
+ * @param filters Filter by attrbutes. If you have filter for owner on your side please send it as {\"attributes.owner\":\"6299dcf3874a14eacbc65c46\"}
* @param linkedContactsIds Filter by linked contacts ids
- * @param linkedDealsIds Filter by linked deals ids
+ * @param linkedDealsIds Filter by linked Deals ids
+ * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
+ * @param createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
* @param page Index of the first document of the page
* @param limit Number of documents per page
* @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
* @param sortBy The field used to sort field names.
*/
- public async companiesGet (filters?: string, linkedContactsIds?: number, linkedDealsIds?: string, page?: number, limit?: number, sort?: 'asc' | 'desc', sortBy?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CompaniesList; }> {
+ public async companiesGet (filters?: string, linkedContactsIds?: number, linkedDealsIds?: string, modifiedSince?: string, createdSince?: string, page?: number, limit?: number, sort?: 'asc' | 'desc', sortBy?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CompaniesList; }> {
const localVarPath = this.basePath + '/companies';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json', 'response'];
+ const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
@@ -202,6 +138,14 @@ export class CompaniesApi {
localVarQueryParameters['linkedDealsIds'] = ObjectSerializer.serialize(linkedDealsIds, "string");
}
+ if (modifiedSince !== undefined) {
+ localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string");
+ }
+
+ if (createdSince !== undefined) {
+ localVarQueryParameters['createdSince'] = ObjectSerializer.serialize(createdSince, "string");
+ }
+
if (page !== undefined) {
localVarQueryParameters['page'] = ObjectSerializer.serialize(page, "number");
}
@@ -232,11 +176,8 @@ export class CompaniesApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -272,7 +213,7 @@ export class CompaniesApi {
/**
*
* @summary Delete a company
- * @param id
+ * @param id Company ID to delete
*/
public async companiesIdDelete (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/companies/{id}'
@@ -307,11 +248,8 @@ export class CompaniesApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -346,7 +284,7 @@ export class CompaniesApi {
/**
*
* @summary Get a company
- * @param id
+ * @param id Get Company Details
*/
public async companiesIdGet (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Company; }> {
const localVarPath = this.basePath + '/companies/{id}'
@@ -381,11 +319,8 @@ export class CompaniesApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -422,9 +357,9 @@ export class CompaniesApi {
*
* @summary Update a company
* @param id
- * @param body Updated company details.
+ * @param companiesIdPatchRequest Updated company details.
*/
- public async companiesIdPatch (id: string, body: CompaniesIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Company; }> {
+ public async companiesIdPatch (id: string, companiesIdPatchRequest: CompaniesIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Company; }> {
const localVarPath = this.basePath + '/companies/{id}'
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
@@ -443,9 +378,9 @@ export class CompaniesApi {
throw new Error('Required parameter id was null or undefined when calling companiesIdPatch.');
}
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling companiesIdPatch.');
+ // verify required parameter 'companiesIdPatchRequest' is not null or undefined
+ if (companiesIdPatchRequest === null || companiesIdPatchRequest === undefined) {
+ throw new Error('Required parameter companiesIdPatchRequest was null or undefined when calling companiesIdPatch.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -459,15 +394,12 @@ export class CompaniesApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "CompaniesIdPatchRequest")
+ body: ObjectSerializer.serialize(companiesIdPatchRequest, "CompaniesIdPatchRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -500,18 +432,94 @@ export class CompaniesApi {
});
});
}
+ /**
+ * Import companies from a CSV file with mapping options.
+ * @summary Import companies(creation and updation)
+ * @param file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) company_id [brevo mongoID to update deals] (b) associated_contact (c) associated_deal (f) any other attribute with internal name
+ * @param mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ```
+ */
+ public async companiesImportPost (file?: RequestFile, mapping?: object, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CompaniesImportPost200Response; }> {
+ const localVarPath = this.basePath + '/companies/import';
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ if (file !== undefined) {
+ localVarFormParams['file'] = file;
+ }
+ localVarUseFormData = true;
+
+ if (mapping !== undefined) {
+ localVarFormParams['mapping'] = ObjectSerializer.serialize(mapping, "object");
+ }
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: CompaniesImportPost200Response; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "CompaniesImportPost200Response");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
/**
*
- * @summary Link and Unlink company with contacts and deals
+ * @summary Link and Unlink company with contact and deal
* @param id
- * @param body Linked / Unlinked contacts and deals ids.
+ * @param companiesLinkUnlinkIdPatchRequest Linked / Unlinked contacts and deals ids.
*/
- public async companiesLinkUnlinkIdPatch (id: string, body: CompaniesLinkUnlinkIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async companiesLinkUnlinkIdPatch (id: string, companiesLinkUnlinkIdPatchRequest: CompaniesLinkUnlinkIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/companies/link-unlink/{id}'
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json', 'response'];
+ const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
@@ -525,9 +533,9 @@ export class CompaniesApi {
throw new Error('Required parameter id was null or undefined when calling companiesLinkUnlinkIdPatch.');
}
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling companiesLinkUnlinkIdPatch.');
+ // verify required parameter 'companiesLinkUnlinkIdPatchRequest' is not null or undefined
+ if (companiesLinkUnlinkIdPatchRequest === null || companiesLinkUnlinkIdPatchRequest === undefined) {
+ throw new Error('Required parameter companiesLinkUnlinkIdPatchRequest was null or undefined when calling companiesLinkUnlinkIdPatch.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -541,15 +549,12 @@ export class CompaniesApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "CompaniesLinkUnlinkIdPatchRequest")
+ body: ObjectSerializer.serialize(companiesLinkUnlinkIdPatchRequest, "CompaniesLinkUnlinkIdPatchRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -584,9 +589,9 @@ export class CompaniesApi {
/**
*
* @summary Create a company
- * @param body Company create data.
+ * @param companiesPostRequest Company create data.
*/
- public async companiesPost (body: CompaniesPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CompaniesPost200Response; }> {
+ public async companiesPost (companiesPostRequest: CompaniesPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CompaniesPost200Response; }> {
const localVarPath = this.basePath + '/companies';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -599,9 +604,9 @@ export class CompaniesApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling companiesPost.');
+ // verify required parameter 'companiesPostRequest' is not null or undefined
+ if (companiesPostRequest === null || companiesPostRequest === undefined) {
+ throw new Error('Required parameter companiesPostRequest was null or undefined when calling companiesPost.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -615,15 +620,12 @@ export class CompaniesApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "CompaniesPostRequest")
+ body: ObjectSerializer.serialize(companiesPostRequest, "CompaniesPostRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -656,4 +658,141 @@ export class CompaniesApi {
});
});
}
+ /**
+ *
+ * @summary Get company attributes
+ */
+ public async crmAttributesCompaniesGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> {
+ const localVarPath = this.basePath + '/crm/attributes/companies';
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'GET',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "Array");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ *
+ * @summary Create a company/deal attribute
+ * @param crmAttributesPostRequest Attribute creation data for a company/deal.
+ */
+ public async crmAttributesPost (crmAttributesPostRequest: CrmAttributesPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CrmAttributesPost200Response; }> {
+ const localVarPath = this.basePath + '/crm/attributes';
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'crmAttributesPostRequest' is not null or undefined
+ if (crmAttributesPostRequest === null || crmAttributesPostRequest === undefined) {
+ throw new Error('Required parameter crmAttributesPostRequest was null or undefined when calling crmAttributesPost.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(crmAttributesPostRequest, "CrmAttributesPostRequest")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: CrmAttributesPost200Response; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "CrmAttributesPost200Response");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
}
diff --git a/api/contactsApi.ts b/api/contactsApi.ts
index c99e163..7431eb8 100644
--- a/api/contactsApi.ts
+++ b/api/contactsApi.ts
@@ -15,7 +15,8 @@ import localVarRequest from 'request';
import http from 'http';
/* tslint:disable:no-unused-locals */
-import { AddContactToList } from '../model/addContactToList';
+import { AddContactToListRequest } from '../model/addContactToListRequest';
+import { ContactErrorModel } from '../model/contactErrorModel';
import { CreateAttribute } from '../model/createAttribute';
import { CreateContact } from '../model/createContact';
import { CreateDoiContact } from '../model/createDoiContact';
@@ -27,6 +28,7 @@ import { CreatedProcessId } from '../model/createdProcessId';
import { ErrorModel } from '../model/errorModel';
import { GetAttributes } from '../model/getAttributes';
import { GetContactCampaignStats } from '../model/getContactCampaignStats';
+import { GetContactInfoIdentifierParameter } from '../model/getContactInfoIdentifierParameter';
import { GetContacts } from '../model/getContacts';
import { GetExtendedContactDetails } from '../model/getExtendedContactDetails';
import { GetExtendedList } from '../model/getExtendedList';
@@ -36,7 +38,7 @@ import { GetFolders } from '../model/getFolders';
import { GetLists } from '../model/getLists';
import { GetSegments } from '../model/getSegments';
import { PostContactInfo } from '../model/postContactInfo';
-import { RemoveContactFromList } from '../model/removeContactFromList';
+import { RemoveContactFromListRequest } from '../model/removeContactFromListRequest';
import { RequestContactExport } from '../model/requestContactExport';
import { RequestContactImport } from '../model/requestContactImport';
import { UpdateAttribute } from '../model/updateAttribute';
@@ -56,8 +58,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum ContactsApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class ContactsApi {
@@ -67,8 +68,7 @@ export class ContactsApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -122,9 +122,9 @@ export class ContactsApi {
*
* @summary Add existing contacts to a list
* @param listId Id of the list
- * @param contactEmails Emails addresses OR IDs of the contacts
+ * @param addContactToListRequest Emails addresses OR IDs OR EXT_ID attributes of the contacts
*/
- public async addContactToList (listId: number, contactEmails: AddContactToList, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> {
+ public async addContactToList (listId: number, addContactToListRequest: AddContactToListRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> {
const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/add'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
let localVarQueryParameters: any = {};
@@ -143,9 +143,9 @@ export class ContactsApi {
throw new Error('Required parameter listId was null or undefined when calling addContactToList.');
}
- // verify required parameter 'contactEmails' is not null or undefined
- if (contactEmails === null || contactEmails === undefined) {
- throw new Error('Required parameter contactEmails was null or undefined when calling addContactToList.');
+ // verify required parameter 'addContactToListRequest' is not null or undefined
+ if (addContactToListRequest === null || addContactToListRequest === undefined) {
+ throw new Error('Required parameter addContactToListRequest was null or undefined when calling addContactToList.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -159,15 +159,12 @@ export class ContactsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(contactEmails, "AddContactToList")
+ body: ObjectSerializer.serialize(addContactToListRequest, "AddContactToListRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -252,11 +249,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -289,7 +283,7 @@ export class ContactsApi {
});
}
/**
- *
+ * Creates new contacts on Brevo. Contacts can be created by passing either -
1. email address of the contact (email_id),
2. phone number of the contact (to be passed as \"SMS\" field in \"attributes\" along with proper country code), For example- {\"SMS\":\"+91xxxxxxxxxx\"} or {\"SMS\":\"0091xxxxxxxxxx\"}
3. ext_id
* @summary Create a contact
* @param createContact Values to create a contact
*/
@@ -326,11 +320,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -401,11 +392,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -475,11 +463,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -550,11 +535,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -632,11 +614,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -669,11 +648,12 @@ export class ContactsApi {
});
}
/**
- *
+ * There are 2 ways to delete a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute.
* @summary Delete a contact
- * @param identifier Email (urlencoded) OR ID of the contact
+ * @param identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded)
+ * @param identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute
*/
- public async deleteContact (identifier: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async deleteContact (identifier: GetContactInfoIdentifierParameter, identifierType?: 'email_id' | 'contact_id' | 'ext_id' | 'phone_id' | 'whatsapp_id' | 'landline_number_id', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/contacts/{identifier}'
.replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier)));
let localVarQueryParameters: any = {};
@@ -692,6 +672,10 @@ export class ContactsApi {
throw new Error('Required parameter identifier was null or undefined when calling deleteContact.');
}
+ if (identifierType !== undefined) {
+ localVarQueryParameters['identifierType'] = ObjectSerializer.serialize(identifierType, "'email_id' | 'contact_id' | 'ext_id' | 'phone_id' | 'whatsapp_id' | 'landline_number_id'");
+ }
+
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -706,11 +690,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -780,11 +761,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -854,11 +832,93 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ *
+ * @summary Delete a multiple-choice attribute option
+ * @param attributeType Type of the attribute
+ * @param multipleChoiceAttribute Name of the existing muliple-choice attribute
+ * @param multipleChoiceAttributeOption Name of the existing multiple-choice attribute option that you want to delete
+ */
+ public async deleteMultiAttributeOptions (attributeType: 'multiple-choice', multipleChoiceAttribute: string, multipleChoiceAttributeOption: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ const localVarPath = this.basePath + '/contacts/attributes/{attributeType}/{multipleChoiceAttribute}/{multipleChoiceAttributeOption}'
+ .replace('{' + 'attributeType' + '}', encodeURIComponent(String(attributeType)))
+ .replace('{' + 'multipleChoiceAttribute' + '}', encodeURIComponent(String(multipleChoiceAttribute)))
+ .replace('{' + 'multipleChoiceAttributeOption' + '}', encodeURIComponent(String(multipleChoiceAttributeOption)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'attributeType' is not null or undefined
+ if (attributeType === null || attributeType === undefined) {
+ throw new Error('Required parameter attributeType was null or undefined when calling deleteMultiAttributeOptions.');
}
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+
+ // verify required parameter 'multipleChoiceAttribute' is not null or undefined
+ if (multipleChoiceAttribute === null || multipleChoiceAttribute === undefined) {
+ throw new Error('Required parameter multipleChoiceAttribute was null or undefined when calling deleteMultiAttributeOptions.');
+ }
+
+ // verify required parameter 'multipleChoiceAttributeOption' is not null or undefined
+ if (multipleChoiceAttributeOption === null || multipleChoiceAttributeOption === undefined) {
+ throw new Error('Required parameter multipleChoiceAttributeOption was null or undefined when calling deleteMultiAttributeOptions.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'DELETE',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -921,11 +981,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -959,13 +1016,14 @@ export class ContactsApi {
});
}
/**
- * Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.brevo.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges.
+ * There are 2 ways to get a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute
Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges.
* @summary Get a contact\'s details
- * @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value
+ * @param identifier Email (urlencoded) OR ID of the contact OR its SMS attribute value OR EXT_ID attribute (urlencoded)
+ * @param identifierType email_id for Email, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute
* @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate
* @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate.
*/
- public async getContactInfo (identifier: string, startDate?: string, endDate?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetExtendedContactDetails; }> {
+ public async getContactInfo (identifier: GetContactInfoIdentifierParameter, identifierType?: 'email_id' | 'phone_id' | 'contact_id' | 'ext_id' | 'whatsapp_id' | 'landline_number_id', startDate?: string, endDate?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetExtendedContactDetails; }> {
const localVarPath = this.basePath + '/contacts/{identifier}'
.replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier)));
let localVarQueryParameters: any = {};
@@ -984,6 +1042,10 @@ export class ContactsApi {
throw new Error('Required parameter identifier was null or undefined when calling getContactInfo.');
}
+ if (identifierType !== undefined) {
+ localVarQueryParameters['identifierType'] = ObjectSerializer.serialize(identifierType, "'email_id' | 'phone_id' | 'contact_id' | 'ext_id' | 'whatsapp_id' | 'landline_number_id'");
+ }
+
if (startDate !== undefined) {
localVarQueryParameters['startDate'] = ObjectSerializer.serialize(startDate, "string");
}
@@ -1006,11 +1068,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1047,10 +1106,10 @@ export class ContactsApi {
*
* @summary Get email campaigns\' statistics for a contact
* @param identifier Email (urlencoded) OR ID of the contact
- * @param startDate Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate
- * @param endDate Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days
+ * @param startDate **Mandatory if endDate is used.** Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate
+ * @param endDate **Mandatory if startDate is used.** Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days
*/
- public async getContactStats (identifier: string, startDate?: string, endDate?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetContactCampaignStats; }> {
+ public async getContactStats (identifier: GetContactInfoIdentifierParameter, startDate?: string, endDate?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetContactCampaignStats; }> {
const localVarPath = this.basePath + '/contacts/{identifier}/campaignStats'
.replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier)));
let localVarQueryParameters: any = {};
@@ -1091,11 +1150,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1133,12 +1189,12 @@ export class ContactsApi {
* @summary Get all the contacts
* @param limit Number of documents per page
* @param offset Index of the first document of the page
- * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
- * @param createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
+ * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
+ * @param createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
* @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
* @param segmentId Id of the segment. **Either listIds or segmentId can be passed.**
* @param listIds Ids of the list. **Either listIds or segmentId can be passed.**
- * @param filter Filter the contacts on the basis of attributes. **Allowed operator: equals. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"))**
+ * @param filter Filter the contacts on the basis of attributes. **Allowed operator: equals. For multiple-choice options, the filter will apply an AND condition between the options. For category attributes, the filter will work with both id and value. (e.g. filter=equals(FIRSTNAME,\"Antoine\"), filter=equals(B1, true), filter=equals(DOB, \"1989-11-23\"), filter=equals(GENDER, \"1\"), filter=equals(GENDER, \"MALE\"), filter=equals(COUNTRY,\"USA, INDIA\")**
*/
public async getContacts (limit?: number, offset?: number, modifiedSince?: string, createdSince?: string, sort?: 'asc' | 'desc', segmentId?: number, listIds?: Array, filter?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetContacts; }> {
const localVarPath = this.basePath + '/contacts';
@@ -1199,11 +1255,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1240,7 +1293,7 @@ export class ContactsApi {
*
* @summary Get contacts in a list
* @param listId Id of the list
- * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
+ * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
* @param limit Number of documents per page
* @param offset Index of the first document of the page
* @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
@@ -1294,11 +1347,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1369,11 +1419,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1459,11 +1506,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1503,7 +1547,7 @@ export class ContactsApi {
* @param offset Index of the first document of the page
* @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
*/
- public async getFolders (limit: number, offset: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetFolders; }> {
+ public async getFolders (limit?: number, offset?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetFolders; }> {
const localVarPath = this.basePath + '/contacts/folders';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -1516,16 +1560,6 @@ export class ContactsApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'limit' is not null or undefined
- if (limit === null || limit === undefined) {
- throw new Error('Required parameter limit was null or undefined when calling getFolders.');
- }
-
- // verify required parameter 'offset' is not null or undefined
- if (offset === null || offset === undefined) {
- throw new Error('Required parameter offset was null or undefined when calling getFolders.');
- }
-
if (limit !== undefined) {
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
}
@@ -1552,11 +1586,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1593,8 +1624,8 @@ export class ContactsApi {
*
* @summary Get a list\'s details
* @param listId Id of the list
- * @param startDate Mandatory if endDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result
- * @param endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id.Prefer to pass your timezone in date-time format for accurate result
+ * @param startDate **Mandatory if endDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result**
+ * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to aggregate the sent email campaigns for a specific list id. **Prefer to pass your timezone in date-time format for accurate result**
*/
public async getList (listId: number, startDate?: string, endDate?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetExtendedList; }> {
const localVarPath = this.basePath + '/contacts/lists/{listId}'
@@ -1637,11 +1668,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1720,11 +1748,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1759,12 +1784,12 @@ export class ContactsApi {
}
/**
*
- * @summary Get all the Segments
+ * @summary Get all the segments
* @param limit Number of documents per page
* @param offset Index of the first document of the page
* @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
*/
- public async getSegments (limit: number, offset: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSegments; }> {
+ public async getSegments (limit?: number, offset?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSegments; }> {
const localVarPath = this.basePath + '/contacts/segments';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -1777,16 +1802,6 @@ export class ContactsApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'limit' is not null or undefined
- if (limit === null || limit === undefined) {
- throw new Error('Required parameter limit was null or undefined when calling getSegments.');
- }
-
- // verify required parameter 'offset' is not null or undefined
- if (offset === null || offset === undefined) {
- throw new Error('Required parameter offset was null or undefined when calling getSegments.');
- }
-
if (limit !== undefined) {
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
}
@@ -1813,11 +1828,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1888,11 +1900,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1929,9 +1938,9 @@ export class ContactsApi {
*
* @summary Delete a contact from a list
* @param listId Id of the list
- * @param contactEmails Emails addresses OR IDs of the contacts
+ * @param contactEmails Emails adresses OR IDs OR EXT_ID attributes of the contacts OR \'all\' true
*/
- public async removeContactFromList (listId: number, contactEmails: RemoveContactFromList, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> {
+ public async removeContactFromList (listId: number, contactEmails: RemoveContactFromListRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: PostContactInfo; }> {
const localVarPath = this.basePath + '/contacts/lists/{listId}/contacts/remove'
.replace('{' + 'listId' + '}', encodeURIComponent(String(listId)));
let localVarQueryParameters: any = {};
@@ -1966,15 +1975,12 @@ export class ContactsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(contactEmails, "RemoveContactFromList")
+ body: ObjectSerializer.serialize(contactEmails, "RemoveContactFromListRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -2045,11 +2051,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -2089,7 +2092,7 @@ export class ContactsApi {
* @param attributeName Name of the existing attribute
* @param updateAttribute Values to update an attribute
*/
- public async updateAttribute (attributeCategory: 'category' | 'calculated' | 'global', attributeName: string, updateAttribute: UpdateAttribute, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async updateAttribute (attributeCategory: 'category' | 'calculated' | 'global' | 'normal', attributeName: string, updateAttribute: UpdateAttribute, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/contacts/attributes/{attributeCategory}/{attributeName}'
.replace('{' + 'attributeCategory' + '}', encodeURIComponent(String(attributeCategory)))
.replace('{' + 'attributeName' + '}', encodeURIComponent(String(attributeName)));
@@ -2134,11 +2137,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -2208,11 +2208,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -2245,12 +2242,13 @@ export class ContactsApi {
});
}
/**
- *
+ * There are 2 ways to update a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
* @summary Update a contact
- * @param identifier Email (urlencoded) OR ID of the contact
+ * @param identifier Email (urlencoded) OR ID of the contact OR EXT_ID attribute (urlencoded) OR its SMS attribute value OR its WHATSAPP attribute value OR its LANDLINE attribute value
* @param updateContact Values to update a contact
+ * @param identifierType email_id for Email, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
*/
- public async updateContact (identifier: string, updateContact: UpdateContact, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async updateContact (identifier: GetContactInfoIdentifierParameter, updateContact: UpdateContact, identifierType?: 'email_id' | 'contact_id' | 'ext_id' | 'phone_id' | 'whatsapp_id' | 'landline_number_id', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/contacts/{identifier}'
.replace('{' + 'identifier' + '}', encodeURIComponent(String(identifier)));
let localVarQueryParameters: any = {};
@@ -2274,6 +2272,10 @@ export class ContactsApi {
throw new Error('Required parameter updateContact was null or undefined when calling updateContact.');
}
+ if (identifierType !== undefined) {
+ localVarQueryParameters['identifierType'] = ObjectSerializer.serialize(identifierType, "'email_id' | 'contact_id' | 'ext_id' | 'phone_id' | 'whatsapp_id' | 'landline_number_id'");
+ }
+
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -2289,11 +2291,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -2370,11 +2369,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -2451,11 +2447,8 @@ export class ContactsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/conversationsApi.ts b/api/conversationsApi.ts
index 04bbf27..1ecd9eb 100644
--- a/api/conversationsApi.ts
+++ b/api/conversationsApi.ts
@@ -19,7 +19,6 @@ import { ConversationsAgentOnlinePingPostRequest } from '../model/conversationsA
import { ConversationsMessage } from '../model/conversationsMessage';
import { ConversationsMessagesIdPutRequest } from '../model/conversationsMessagesIdPutRequest';
import { ConversationsMessagesPostRequest } from '../model/conversationsMessagesPostRequest';
-import { ConversationsPushedMessagesIdPutRequest } from '../model/conversationsPushedMessagesIdPutRequest';
import { ConversationsPushedMessagesPostRequest } from '../model/conversationsPushedMessagesPostRequest';
import { ErrorModel } from '../model/errorModel';
@@ -35,8 +34,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum ConversationsApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class ConversationsApi {
@@ -46,8 +44,7 @@ export class ConversationsApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -100,9 +97,9 @@ export class ConversationsApi {
/**
* We recommend pinging this endpoint every minute for as long as the agent has to be considered online.
* @summary Sets agent’s status to online for 2-3 minutes
- * @param body Agent fields.
+ * @param conversationsAgentOnlinePingPostRequest
*/
- public async conversationsAgentOnlinePingPost (body: ConversationsAgentOnlinePingPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async conversationsAgentOnlinePingPost (conversationsAgentOnlinePingPostRequest: ConversationsAgentOnlinePingPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/conversations/agentOnlinePing';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -115,9 +112,9 @@ export class ConversationsApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling conversationsAgentOnlinePingPost.');
+ // verify required parameter 'conversationsAgentOnlinePingPostRequest' is not null or undefined
+ if (conversationsAgentOnlinePingPostRequest === null || conversationsAgentOnlinePingPostRequest === undefined) {
+ throw new Error('Required parameter conversationsAgentOnlinePingPostRequest was null or undefined when calling conversationsAgentOnlinePingPost.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -131,15 +128,12 @@ export class ConversationsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "ConversationsAgentOnlinePingPostRequest")
+ body: ObjectSerializer.serialize(conversationsAgentOnlinePingPostRequest, "ConversationsAgentOnlinePingPostRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -209,11 +203,8 @@ export class ConversationsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -283,11 +274,8 @@ export class ConversationsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -324,9 +312,9 @@ export class ConversationsApi {
* Only agents’ messages can be edited.
* @summary Update a message sent by an agent
* @param id ID of the message
- * @param body
+ * @param conversationsMessagesIdPutRequest
*/
- public async conversationsMessagesIdPut (id: string, body?: ConversationsMessagesIdPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> {
+ public async conversationsMessagesIdPut (id: string, conversationsMessagesIdPutRequest: ConversationsMessagesIdPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> {
const localVarPath = this.basePath + '/conversations/messages/{id}'
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
@@ -345,6 +333,11 @@ export class ConversationsApi {
throw new Error('Required parameter id was null or undefined when calling conversationsMessagesIdPut.');
}
+ // verify required parameter 'conversationsMessagesIdPutRequest' is not null or undefined
+ if (conversationsMessagesIdPutRequest === null || conversationsMessagesIdPutRequest === undefined) {
+ throw new Error('Required parameter conversationsMessagesIdPutRequest was null or undefined when calling conversationsMessagesIdPut.');
+ }
+
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -356,15 +349,12 @@ export class ConversationsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "ConversationsMessagesIdPutRequest")
+ body: ObjectSerializer.serialize(conversationsMessagesIdPutRequest, "ConversationsMessagesIdPutRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -400,9 +390,9 @@ export class ConversationsApi {
/**
*
* @summary Send a message as an agent
- * @param body Message fields.
+ * @param conversationsMessagesPostRequest
*/
- public async conversationsMessagesPost (body: ConversationsMessagesPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> {
+ public async conversationsMessagesPost (conversationsMessagesPostRequest: ConversationsMessagesPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> {
const localVarPath = this.basePath + '/conversations/messages';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -415,9 +405,9 @@ export class ConversationsApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling conversationsMessagesPost.');
+ // verify required parameter 'conversationsMessagesPostRequest' is not null or undefined
+ if (conversationsMessagesPostRequest === null || conversationsMessagesPostRequest === undefined) {
+ throw new Error('Required parameter conversationsMessagesPostRequest was null or undefined when calling conversationsMessagesPost.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -431,15 +421,12 @@ export class ConversationsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "ConversationsMessagesPostRequest")
+ body: ObjectSerializer.serialize(conversationsMessagesPostRequest, "ConversationsMessagesPostRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -510,11 +497,8 @@ export class ConversationsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -584,11 +568,8 @@ export class ConversationsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -625,9 +606,9 @@ export class ConversationsApi {
*
* @summary Update an automated message
* @param id ID of the message
- * @param body
+ * @param conversationsMessagesIdPutRequest
*/
- public async conversationsPushedMessagesIdPut (id: string, body: ConversationsPushedMessagesIdPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> {
+ public async conversationsPushedMessagesIdPut (id: string, conversationsMessagesIdPutRequest: ConversationsMessagesIdPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> {
const localVarPath = this.basePath + '/conversations/pushedMessages/{id}'
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
@@ -646,9 +627,9 @@ export class ConversationsApi {
throw new Error('Required parameter id was null or undefined when calling conversationsPushedMessagesIdPut.');
}
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling conversationsPushedMessagesIdPut.');
+ // verify required parameter 'conversationsMessagesIdPutRequest' is not null or undefined
+ if (conversationsMessagesIdPutRequest === null || conversationsMessagesIdPutRequest === undefined) {
+ throw new Error('Required parameter conversationsMessagesIdPutRequest was null or undefined when calling conversationsPushedMessagesIdPut.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -662,15 +643,12 @@ export class ConversationsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "ConversationsPushedMessagesIdPutRequest")
+ body: ObjectSerializer.serialize(conversationsMessagesIdPutRequest, "ConversationsMessagesIdPutRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -706,9 +684,9 @@ export class ConversationsApi {
/**
* Example of automated messages: order status, announce new features in your web app, etc.
* @summary Send an automated message to a visitor
- * @param body
+ * @param conversationsPushedMessagesPostRequest
*/
- public async conversationsPushedMessagesPost (body: ConversationsPushedMessagesPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> {
+ public async conversationsPushedMessagesPost (conversationsPushedMessagesPostRequest: ConversationsPushedMessagesPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ConversationsMessage; }> {
const localVarPath = this.basePath + '/conversations/pushedMessages';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -721,9 +699,9 @@ export class ConversationsApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling conversationsPushedMessagesPost.');
+ // verify required parameter 'conversationsPushedMessagesPostRequest' is not null or undefined
+ if (conversationsPushedMessagesPostRequest === null || conversationsPushedMessagesPostRequest === undefined) {
+ throw new Error('Required parameter conversationsPushedMessagesPostRequest was null or undefined when calling conversationsPushedMessagesPost.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -737,15 +715,12 @@ export class ConversationsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "ConversationsPushedMessagesPostRequest")
+ body: ObjectSerializer.serialize(conversationsPushedMessagesPostRequest, "ConversationsPushedMessagesPostRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/couponsApi.ts b/api/couponsApi.ts
index f53bcbd..c5f4efe 100644
--- a/api/couponsApi.ts
+++ b/api/couponsApi.ts
@@ -35,8 +35,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum CouponsApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class CouponsApi {
@@ -46,8 +45,7 @@ export class CouponsApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -100,9 +98,9 @@ export class CouponsApi {
/**
*
* @summary Create а coupon collection
- * @param createCouponCollection Values to create a coupon collection
+ * @param createCouponCollectionRequest Values to create a coupon collection
*/
- public async createCouponCollection (createCouponCollection: CreateCouponCollectionRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateCouponCollection201Response; }> {
+ public async createCouponCollection (createCouponCollectionRequest: CreateCouponCollectionRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateCouponCollection201Response; }> {
const localVarPath = this.basePath + '/couponCollections';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -115,9 +113,9 @@ export class CouponsApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'createCouponCollection' is not null or undefined
- if (createCouponCollection === null || createCouponCollection === undefined) {
- throw new Error('Required parameter createCouponCollection was null or undefined when calling createCouponCollection.');
+ // verify required parameter 'createCouponCollectionRequest' is not null or undefined
+ if (createCouponCollectionRequest === null || createCouponCollectionRequest === undefined) {
+ throw new Error('Required parameter createCouponCollectionRequest was null or undefined when calling createCouponCollection.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -131,15 +129,12 @@ export class CouponsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(createCouponCollection, "CreateCouponCollectionRequest")
+ body: ObjectSerializer.serialize(createCouponCollectionRequest, "CreateCouponCollectionRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -175,9 +170,9 @@ export class CouponsApi {
/**
*
* @summary Create coupons for a coupon collection
- * @param createCoupons Values to create coupons
+ * @param createCouponsRequest Values to create coupons
*/
- public async createCoupons (createCoupons: CreateCouponsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async createCoupons (createCouponsRequest: CreateCouponsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/coupons';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -190,9 +185,9 @@ export class CouponsApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'createCoupons' is not null or undefined
- if (createCoupons === null || createCoupons === undefined) {
- throw new Error('Required parameter createCoupons was null or undefined when calling createCoupons.');
+ // verify required parameter 'createCouponsRequest' is not null or undefined
+ if (createCouponsRequest === null || createCouponsRequest === undefined) {
+ throw new Error('Required parameter createCouponsRequest was null or undefined when calling createCoupons.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -206,15 +201,12 @@ export class CouponsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(createCoupons, "CreateCouponsRequest")
+ body: ObjectSerializer.serialize(createCouponsRequest, "CreateCouponsRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -256,7 +248,7 @@ export class CouponsApi {
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json', 'response'];
+ const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
@@ -284,11 +276,8 @@ export class CouponsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -333,7 +322,7 @@ export class CouponsApi {
const localVarPath = this.basePath + '/couponCollections';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json', 'response'];
+ const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
@@ -372,11 +361,8 @@ export class CouponsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -413,9 +399,9 @@ export class CouponsApi {
*
* @summary Update a coupon collection by id
* @param id Id of the collection to update
- * @param updateCouponCollection Values to update the coupon collection
+ * @param updateCouponCollectionRequest Values to update the coupon collection
*/
- public async updateCouponCollection (id: string, updateCouponCollection?: UpdateCouponCollectionRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: UpdateCouponCollection200Response; }> {
+ public async updateCouponCollection (id: string, updateCouponCollectionRequest?: UpdateCouponCollectionRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: UpdateCouponCollection200Response; }> {
const localVarPath = this.basePath + '/couponCollections/{id}'
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
@@ -445,15 +431,12 @@ export class CouponsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(updateCouponCollection, "UpdateCouponCollectionRequest")
+ body: ObjectSerializer.serialize(updateCouponCollectionRequest, "UpdateCouponCollectionRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/dealsApi.ts b/api/dealsApi.ts
index 7bb4e14..e671121 100644
--- a/api/dealsApi.ts
+++ b/api/dealsApi.ts
@@ -15,6 +15,10 @@ import localVarRequest from 'request';
import http from 'http';
/* tslint:disable:no-unused-locals */
+import { CompaniesImportPost200Response } from '../model/companiesImportPost200Response';
+import { CompaniesImportPost400Response } from '../model/companiesImportPost400Response';
+import { CrmAttributesPost200Response } from '../model/crmAttributesPost200Response';
+import { CrmAttributesPostRequest } from '../model/crmAttributesPostRequest';
import { CrmDealsIdPatchRequest } from '../model/crmDealsIdPatchRequest';
import { CrmDealsLinkUnlinkIdPatchRequest } from '../model/crmDealsLinkUnlinkIdPatchRequest';
import { CrmDealsPost201Response } from '../model/crmDealsPost201Response';
@@ -37,8 +41,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum DealsApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class DealsApi {
@@ -48,8 +51,7 @@ export class DealsApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -130,11 +132,8 @@ export class DealsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -167,22 +166,95 @@ export class DealsApi {
});
});
}
+ /**
+ *
+ * @summary Create a company/deal attribute
+ * @param crmAttributesPostRequest Attribute creation data for a company/deal.
+ */
+ public async crmAttributesPost (crmAttributesPostRequest: CrmAttributesPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CrmAttributesPost200Response; }> {
+ const localVarPath = this.basePath + '/crm/attributes';
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'crmAttributesPostRequest' is not null or undefined
+ if (crmAttributesPostRequest === null || crmAttributesPostRequest === undefined) {
+ throw new Error('Required parameter crmAttributesPostRequest was null or undefined when calling crmAttributesPost.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(crmAttributesPostRequest, "CrmAttributesPostRequest")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: CrmAttributesPost200Response; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "CrmAttributesPost200Response");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
/**
*
* @summary Get all deals
* @param filtersAttributesDealName Filter by attributes. If you have a filter for the owner on your end, please send it as filters[attributes.deal_owner] and utilize the account email for the filtering.
* @param filtersLinkedCompaniesIds Filter by linked companies ids
* @param filtersLinkedContactsIds Filter by linked companies ids
+ * @param modifiedSince Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
+ * @param createdSince Filter (urlencoded) the contacts created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
* @param offset Index of the first document of the page
* @param limit Number of documents per page
* @param sort Sort the results in the ascending/descending order. Default order is **descending** by creation if `sort` is not passed
- * @param sortBy The field used to sort field names.
*/
- public async crmDealsGet (filtersAttributesDealName?: string, filtersLinkedCompaniesIds?: string, filtersLinkedContactsIds?: string, offset?: number, limit?: number, sort?: 'asc' | 'desc', sortBy?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: DealsList; }> {
+ public async crmDealsGet (filtersAttributesDealName?: string, filtersLinkedCompaniesIds?: string, filtersLinkedContactsIds?: string, modifiedSince?: string, createdSince?: string, offset?: number, limit?: number, sort?: 'asc' | 'desc', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: DealsList; }> {
const localVarPath = this.basePath + '/crm/deals';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json', 'response'];
+ const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
@@ -203,6 +275,14 @@ export class DealsApi {
localVarQueryParameters['filters[linkedContactsIds]'] = ObjectSerializer.serialize(filtersLinkedContactsIds, "string");
}
+ if (modifiedSince !== undefined) {
+ localVarQueryParameters['modifiedSince'] = ObjectSerializer.serialize(modifiedSince, "string");
+ }
+
+ if (createdSince !== undefined) {
+ localVarQueryParameters['createdSince'] = ObjectSerializer.serialize(createdSince, "string");
+ }
+
if (offset !== undefined) {
localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number");
}
@@ -215,10 +295,6 @@ export class DealsApi {
localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'");
}
- if (sortBy !== undefined) {
- localVarQueryParameters['sortBy'] = ObjectSerializer.serialize(sortBy, "string");
- }
-
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -233,11 +309,8 @@ export class DealsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -308,11 +381,8 @@ export class DealsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -382,11 +452,8 @@ export class DealsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -423,9 +490,9 @@ export class DealsApi {
*
* @summary Update a deal
* @param id
- * @param body Updated deal details.
+ * @param crmDealsIdPatchRequest Updated deal details.
*/
- public async crmDealsIdPatch (id: string, body: CrmDealsIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async crmDealsIdPatch (id: string, crmDealsIdPatchRequest: CrmDealsIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/crm/deals/{id}'
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
@@ -444,9 +511,9 @@ export class DealsApi {
throw new Error('Required parameter id was null or undefined when calling crmDealsIdPatch.');
}
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling crmDealsIdPatch.');
+ // verify required parameter 'crmDealsIdPatchRequest' is not null or undefined
+ if (crmDealsIdPatchRequest === null || crmDealsIdPatchRequest === undefined) {
+ throw new Error('Required parameter crmDealsIdPatchRequest was null or undefined when calling crmDealsIdPatch.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -460,15 +527,12 @@ export class DealsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "CrmDealsIdPatchRequest")
+ body: ObjectSerializer.serialize(crmDealsIdPatchRequest, "CrmDealsIdPatchRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -500,18 +564,94 @@ export class DealsApi {
});
});
}
+ /**
+ * Import deals from a CSV file with mapping options.
+ * @summary Import deals(creation and updation)
+ * @param file The CSV file to upload.The file should have the first row as the mapping attribute. Some default attribute names are (a) deal_id [brevo mongoID to update deals] (b) associated_contact (c) associated_company (f) any other attribute with internal name
+ * @param mapping The mapping options in JSON format. Here is an example of the JSON structure: ```json { \\\"link_entities\\\": true, // Determines whether to link related entities during the import process \\\"unlink_entities\\\": false, // Determines whether to unlink related entities during the import process \\\"update_existing_records\\\": true, // Determines whether to update based on company ID or treat every row as create \\\"unset_empty_attributes\\\": false // Determines whether to unset a specific attribute during update if the values input is blank } ```
+ */
+ public async crmDealsImportPost (file?: RequestFile, mapping?: object, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CompaniesImportPost200Response; }> {
+ const localVarPath = this.basePath + '/crm/deals/import';
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ if (file !== undefined) {
+ localVarFormParams['file'] = file;
+ }
+ localVarUseFormData = true;
+
+ if (mapping !== undefined) {
+ localVarFormParams['mapping'] = ObjectSerializer.serialize(mapping, "object");
+ }
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: CompaniesImportPost200Response; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "CompaniesImportPost200Response");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
/**
*
* @summary Link and Unlink a deal with contacts and companies
* @param id
- * @param body Linked / Unlinked contacts and companies ids.
+ * @param crmDealsLinkUnlinkIdPatchRequest Linked / Unlinked contacts and companies ids.
*/
- public async crmDealsLinkUnlinkIdPatch (id: string, body: CrmDealsLinkUnlinkIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async crmDealsLinkUnlinkIdPatch (id: string, crmDealsLinkUnlinkIdPatchRequest: CrmDealsLinkUnlinkIdPatchRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/crm/deals/link-unlink/{id}'
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json', 'response'];
+ const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
@@ -525,9 +665,9 @@ export class DealsApi {
throw new Error('Required parameter id was null or undefined when calling crmDealsLinkUnlinkIdPatch.');
}
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling crmDealsLinkUnlinkIdPatch.');
+ // verify required parameter 'crmDealsLinkUnlinkIdPatchRequest' is not null or undefined
+ if (crmDealsLinkUnlinkIdPatchRequest === null || crmDealsLinkUnlinkIdPatchRequest === undefined) {
+ throw new Error('Required parameter crmDealsLinkUnlinkIdPatchRequest was null or undefined when calling crmDealsLinkUnlinkIdPatch.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -541,15 +681,12 @@ export class DealsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "CrmDealsLinkUnlinkIdPatchRequest")
+ body: ObjectSerializer.serialize(crmDealsLinkUnlinkIdPatchRequest, "CrmDealsLinkUnlinkIdPatchRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -584,9 +721,9 @@ export class DealsApi {
/**
*
* @summary Create a deal
- * @param body Deal create data.
+ * @param crmDealsPostRequest Deal create data.
*/
- public async crmDealsPost (body: CrmDealsPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CrmDealsPost201Response; }> {
+ public async crmDealsPost (crmDealsPostRequest: CrmDealsPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CrmDealsPost201Response; }> {
const localVarPath = this.basePath + '/crm/deals';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -599,9 +736,9 @@ export class DealsApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling crmDealsPost.');
+ // verify required parameter 'crmDealsPostRequest' is not null or undefined
+ if (crmDealsPostRequest === null || crmDealsPostRequest === undefined) {
+ throw new Error('Required parameter crmDealsPostRequest was null or undefined when calling crmDealsPost.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -615,15 +752,12 @@ export class DealsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "CrmDealsPostRequest")
+ body: ObjectSerializer.serialize(crmDealsPostRequest, "CrmDealsPostRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -687,11 +821,8 @@ export class DealsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -727,6 +858,8 @@ export class DealsApi {
/**
* This endpoint is deprecated. Prefer /crm/pipeline/details/{pipelineID} instead.
* @summary Get pipeline stages
+ *
+ * @deprecated
*/
public async crmPipelineDetailsGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Pipeline; }> {
const localVarPath = this.basePath + '/crm/pipeline/details';
@@ -755,11 +888,8 @@ export class DealsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -830,11 +960,8 @@ export class DealsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/domainsApi.ts b/api/domainsApi.ts
index 7e2d664..42a55c0 100644
--- a/api/domainsApi.ts
+++ b/api/domainsApi.ts
@@ -34,8 +34,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum DomainsApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class DomainsApi {
@@ -45,8 +44,7 @@ export class DomainsApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -134,11 +132,8 @@ export class DomainsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -174,9 +169,9 @@ export class DomainsApi {
/**
*
* @summary Create a new domain
- * @param domainName domain\'s name
+ * @param domain domain\'s name
*/
- public async createDomain (domainName?: CreateDomain, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateDomainModel; }> {
+ public async createDomain (domain?: CreateDomain, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateDomainModel; }> {
const localVarPath = this.basePath + '/senders/domains';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -200,15 +195,12 @@ export class DomainsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(domainName, "CreateDomain")
+ body: ObjectSerializer.serialize(domain, "CreateDomain")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -279,11 +271,8 @@ export class DomainsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -353,11 +342,8 @@ export class DomainsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -421,11 +407,8 @@ export class DomainsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/ecommerceApi.ts b/api/ecommerceApi.ts
index b629a36..d158445 100644
--- a/api/ecommerceApi.ts
+++ b/api/ecommerceApi.ts
@@ -23,6 +23,7 @@ import { CreateUpdateBatchProducts } from '../model/createUpdateBatchProducts';
import { CreateUpdateBatchProductsModel } from '../model/createUpdateBatchProductsModel';
import { CreateUpdateCategory } from '../model/createUpdateCategory';
import { CreateUpdateProduct } from '../model/createUpdateProduct';
+import { CreatedBatchId } from '../model/createdBatchId';
import { EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response } from '../model/ecommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response';
import { EcommerceAttributionMetricsGet200Response } from '../model/ecommerceAttributionMetricsGet200Response';
import { EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response } from '../model/ecommerceAttributionProductsConversionSourceConversionSourceIdGet200Response';
@@ -30,7 +31,6 @@ import { EcommerceConfigDisplayCurrencyGet200Response } from '../model/ecommerce
import { ErrorModel } from '../model/errorModel';
import { GetCategories } from '../model/getCategories';
import { GetCategoryDetails } from '../model/getCategoryDetails';
-import { GetOrders } from '../model/getOrders';
import { GetProductDetails } from '../model/getProductDetails';
import { GetProducts } from '../model/getProducts';
import { Order } from '../model/order';
@@ -48,8 +48,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum EcommerceApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class EcommerceApi {
@@ -59,8 +58,7 @@ export class EcommerceApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -115,7 +113,7 @@ export class EcommerceApi {
* @summary Create orders in batch
* @param orderBatch
*/
- public async createBatchOrder (orderBatch: OrderBatch, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async createBatchOrder (orderBatch: OrderBatch, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreatedBatchId; }> {
const localVarPath = this.basePath + '/orders/status/batch';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -148,11 +146,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -169,12 +164,13 @@ export class EcommerceApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: CreatedBatchId; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "CreatedBatchId");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -222,11 +218,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -296,11 +289,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -371,11 +361,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -446,11 +433,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -521,11 +505,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -589,11 +570,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -627,11 +605,11 @@ export class EcommerceApi {
}
/**
*
- * @summary Get detailed attribution metrics for a single Brevo campaign
- * @param conversionSource The Brevo campaign type for which data will be retrieved
- * @param conversionSourceId The Brevo campaign id for which data will be retrieved
+ * @summary Get detailed attribution metrics for a single Brevo campaign or workflow
+ * @param conversionSource The Brevo campaign type or workflow type for which data will be retrieved
+ * @param conversionSourceId The Brevo campaign or automation workflow id for which data will be retrieved
*/
- public async ecommerceAttributionMetricsConversionSourceConversionSourceIdGet (conversionSource: 'email_campaign', conversionSourceId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response; }> {
+ public async ecommerceAttributionMetricsConversionSourceConversionSourceIdGet (conversionSource: 'email_campaign' | 'sms_campaign' | 'automation_workflow_email' | 'automation_workflow_sms', conversionSourceId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: EcommerceAttributionMetricsConversionSourceConversionSourceIdGet200Response; }> {
const localVarPath = this.basePath + '/ecommerce/attribution/metrics/{conversionSource}/{conversionSourceId}'
.replace('{' + 'conversionSource' + '}', encodeURIComponent(String(conversionSource)))
.replace('{' + 'conversionSourceId' + '}', encodeURIComponent(String(conversionSourceId)));
@@ -670,11 +648,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -709,12 +684,15 @@ export class EcommerceApi {
}
/**
*
- * @summary Get attribution metrics for one or more Brevo campaigns
+ * @summary Get attribution metrics for one or more Brevo campaigns or workflows
* @param periodFrom When getting metrics for a specific period, define the starting datetime in RFC3339 format
* @param periodTo When getting metrics for a specific period, define the end datetime in RFC3339 format
- * @param emailCampaignId The email campaign id(s) to get metrics for
+ * @param emailCampaignId The email campaign ID(s) to get metrics for
+ * @param smsCampaignId The SMS campaign ID(s) to get metrics for
+ * @param automationWorkflowEmailId The automation workflow ID(s) to get email attribution metrics for
+ * @param automationWorkflowSmsId The automation workflow ID(s) to get SMS attribution metrics for
*/
- public async ecommerceAttributionMetricsGet (periodFrom?: Date, periodTo?: Date, emailCampaignId?: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: EcommerceAttributionMetricsGet200Response; }> {
+ public async ecommerceAttributionMetricsGet (periodFrom?: Date, periodTo?: Date, emailCampaignId?: Array, smsCampaignId?: Array, automationWorkflowEmailId?: Array, automationWorkflowSmsId?: Array, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: EcommerceAttributionMetricsGet200Response; }> {
const localVarPath = this.basePath + '/ecommerce/attribution/metrics';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -736,7 +714,19 @@ export class EcommerceApi {
}
if (emailCampaignId !== undefined) {
- localVarQueryParameters['emailCampaignId[]'] = ObjectSerializer.serialize(emailCampaignId, "Array");
+ localVarQueryParameters['emailCampaignId[]'] = ObjectSerializer.serialize(emailCampaignId, "Array");
+ }
+
+ if (smsCampaignId !== undefined) {
+ localVarQueryParameters['smsCampaignId[]'] = ObjectSerializer.serialize(smsCampaignId, "Array");
+ }
+
+ if (automationWorkflowEmailId !== undefined) {
+ localVarQueryParameters['automationWorkflowEmailId[]'] = ObjectSerializer.serialize(automationWorkflowEmailId, "Array");
+ }
+
+ if (automationWorkflowSmsId !== undefined) {
+ localVarQueryParameters['automationWorkflowSmsId[]'] = ObjectSerializer.serialize(automationWorkflowSmsId, "Array");
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -753,11 +743,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -792,11 +779,11 @@ export class EcommerceApi {
}
/**
*
- * @summary Get attributed product sales for a single Brevo campaign
- * @param conversionSource The Brevo campaign type for which data will be retrieved
- * @param conversionSourceId The Brevo campaign id for which data will be retrieved
+ * @summary Get attributed product sales for a single Brevo campaign or workflow
+ * @param conversionSource The Brevo campaign or automation workflow type for which data will be retrieved
+ * @param conversionSourceId The Brevo campaign or automation workflow id for which data will be retrieved
*/
- public async ecommerceAttributionProductsConversionSourceConversionSourceIdGet (conversionSource: 'email_campaign', conversionSourceId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response; }> {
+ public async ecommerceAttributionProductsConversionSourceConversionSourceIdGet (conversionSource: 'email_campaign' | 'sms_campaign' | 'automation_workflow_email' | 'automation_workflow_sms', conversionSourceId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: EcommerceAttributionProductsConversionSourceConversionSourceIdGet200Response; }> {
const localVarPath = this.basePath + '/ecommerce/attribution/products/{conversionSource}/{conversionSourceId}'
.replace('{' + 'conversionSource' + '}', encodeURIComponent(String(conversionSource)))
.replace('{' + 'conversionSourceId' + '}', encodeURIComponent(String(conversionSourceId)));
@@ -835,11 +822,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -903,11 +887,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -948,8 +929,8 @@ export class EcommerceApi {
* @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
* @param ids Filter by category ids
* @param name Filter by category name
- * @param modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
- * @param createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
+ * @param modifiedSince Filter (urlencoded) the categories modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
+ * @param createdSince Filter (urlencoded) the categories created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
*/
public async getCategories (limit?: number, offset?: number, sort?: 'asc' | 'desc', ids?: Array, name?: string, modifiedSince?: string, createdSince?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetCategories; }> {
const localVarPath = this.basePath + '/categories';
@@ -1006,11 +987,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1081,11 +1059,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1127,11 +1102,11 @@ export class EcommerceApi {
* @param modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
* @param createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
*/
- public async getOrders (limit?: number, offset?: number, sort?: 'asc' | 'desc', modifiedSince?: string, createdSince?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetOrders; }> {
+ public async getOrders (limit?: number, offset?: number, sort?: 'asc' | 'desc', modifiedSince?: string, createdSince?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/orders';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json', 'response'];
+ const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
@@ -1174,11 +1149,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1195,13 +1167,12 @@ export class EcommerceApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body: GetOrders; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- body = ObjectSerializer.deserialize(body, "GetOrders");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@@ -1249,11 +1220,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1300,7 +1268,7 @@ export class EcommerceApi {
* @param priceGt Price filter for products greater than particular amount
* @param priceEq Price filter for products equals to particular amount
* @param priceNe Price filter for products not equals to particular amount
- * @param categories Filter by category ids
+ * @param categories Filter by product categories
* @param modifiedSince Filter (urlencoded) the orders modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
* @param createdSince Filter (urlencoded) the orders created after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). **Prefer to pass your timezone in date-time format for accurate result.**
*/
@@ -1387,11 +1355,8 @@ export class EcommerceApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1427,9 +1392,9 @@ export class EcommerceApi {
/**
*
* @summary Set the ISO 4217 compliant display currency code for your Brevo account
- * @param setConfigDisplayCurrency set ISO 4217 compliant display currency code payload
+ * @param ecommerceConfigDisplayCurrencyGet200Response set ISO 4217 compliant display currency code payload
*/
- public async setConfigDisplayCurrency (setConfigDisplayCurrency: EcommerceConfigDisplayCurrencyGet200Response, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: EcommerceConfigDisplayCurrencyGet200Response; }> {
+ public async setConfigDisplayCurrency (ecommerceConfigDisplayCurrencyGet200Response?: EcommerceConfigDisplayCurrencyGet200Response, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: EcommerceConfigDisplayCurrencyGet200Response; }> {
const localVarPath = this.basePath + '/ecommerce/config/displayCurrency';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -1442,11 +1407,6 @@ export class EcommerceApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'setConfigDisplayCurrency' is not null or undefined
- if (setConfigDisplayCurrency === null || setConfigDisplayCurrency === undefined) {
- throw new Error('Required parameter setConfigDisplayCurrency was null or undefined when calling setConfigDisplayCurrency.');
- }
-
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -1458,15 +1418,12 @@ export class EcommerceApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(setConfigDisplayCurrency, "EcommerceConfigDisplayCurrencyGet200Response")
+ body: ObjectSerializer.serialize(ecommerceConfigDisplayCurrencyGet200Response, "EcommerceConfigDisplayCurrencyGet200Response")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/emailCampaignsApi.ts b/api/emailCampaignsApi.ts
index d4cf370..5434fcd 100644
--- a/api/emailCampaignsApi.ts
+++ b/api/emailCampaignsApi.ts
@@ -44,8 +44,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum EmailCampaignsApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class EmailCampaignsApi {
@@ -55,8 +54,7 @@ export class EmailCampaignsApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -109,9 +107,9 @@ export class EmailCampaignsApi {
/**
*
* @summary Create an email campaign
- * @param emailCampaigns Values to create a campaign
+ * @param createEmailCampaign Values to create a campaign
*/
- public async createEmailCampaign (emailCampaigns: CreateEmailCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> {
+ public async createEmailCampaign (createEmailCampaign: CreateEmailCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateModel; }> {
const localVarPath = this.basePath + '/emailCampaigns';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -124,9 +122,9 @@ export class EmailCampaignsApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'emailCampaigns' is not null or undefined
- if (emailCampaigns === null || emailCampaigns === undefined) {
- throw new Error('Required parameter emailCampaigns was null or undefined when calling createEmailCampaign.');
+ // verify required parameter 'createEmailCampaign' is not null or undefined
+ if (createEmailCampaign === null || createEmailCampaign === undefined) {
+ throw new Error('Required parameter createEmailCampaign was null or undefined when calling createEmailCampaign.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -140,15 +138,12 @@ export class EmailCampaignsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(emailCampaigns, "CreateEmailCampaign")
+ body: ObjectSerializer.serialize(createEmailCampaign, "CreateEmailCampaign")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -219,11 +214,8 @@ export class EmailCampaignsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -259,9 +251,9 @@ export class EmailCampaignsApi {
*
* @summary Export the recipients of an email campaign
* @param campaignId Id of the campaign
- * @param recipientExport Values to send for a recipient export request
+ * @param emailExportRecipients Values to send for a recipient export request
*/
- public async emailExportRecipients (campaignId: number, recipientExport?: EmailExportRecipients, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }> {
+ public async emailExportRecipients (campaignId: number, emailExportRecipients?: EmailExportRecipients, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreatedProcessId; }> {
const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/exportRecipients'
.replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId)));
let localVarQueryParameters: any = {};
@@ -291,15 +283,12 @@ export class EmailCampaignsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(recipientExport, "EmailExportRecipients")
+ body: ObjectSerializer.serialize(emailExportRecipients, "EmailExportRecipients")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -370,11 +359,8 @@ export class EmailCampaignsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -450,11 +436,8 @@ export class EmailCampaignsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -493,8 +476,8 @@ export class EmailCampaignsApi {
* @param type Filter on the type of the campaigns
* @param status Filter on the status of the campaign
* @param statistics Filter on the type of statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.This option only returns data for events occurred in the last 6 months.For older campaigns, it’s advisable to use the **Get Campaign Report** endpoint.
- * @param startDate Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either \'status\' not passed and if passed is set to \'sent\' )
- * @param endDate Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either \'status\' not passed and if passed is set to \'sent\' )
+ * @param startDate **Mandatory if endDate is used**. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either \'status\' not passed and if passed is set to \'sent\' )
+ * @param endDate **Mandatory if startDate is used**. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. **Prefer to pass your timezone in date-time format for accurate result** ( only available if either \'status\' not passed and if passed is set to \'sent\' )
* @param limit Number of documents per page
* @param offset Index of the first document in the page
* @param sort Sort the results in the ascending/descending order of record creation. Default order is **descending** if `sort` is not passed
@@ -504,7 +487,7 @@ export class EmailCampaignsApi {
const localVarPath = this.basePath + '/emailCampaigns';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json', 'applications/json'];
+ const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
@@ -563,11 +546,8 @@ export class EmailCampaignsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -638,11 +618,8 @@ export class EmailCampaignsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -713,11 +690,8 @@ export class EmailCampaignsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -794,11 +768,8 @@ export class EmailCampaignsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -834,9 +805,9 @@ export class EmailCampaignsApi {
*
* @summary Send an email campaign to your test list
* @param campaignId Id of the campaign
- * @param emailTo
+ * @param sendTestEmail
*/
- public async sendTestEmail (campaignId: number, emailTo: SendTestEmail, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async sendTestEmail (campaignId: number, sendTestEmail: SendTestEmail, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/sendTest'
.replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId)));
let localVarQueryParameters: any = {};
@@ -855,9 +826,9 @@ export class EmailCampaignsApi {
throw new Error('Required parameter campaignId was null or undefined when calling sendTestEmail.');
}
- // verify required parameter 'emailTo' is not null or undefined
- if (emailTo === null || emailTo === undefined) {
- throw new Error('Required parameter emailTo was null or undefined when calling sendTestEmail.');
+ // verify required parameter 'sendTestEmail' is not null or undefined
+ if (sendTestEmail === null || sendTestEmail === undefined) {
+ throw new Error('Required parameter sendTestEmail was null or undefined when calling sendTestEmail.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -871,15 +842,12 @@ export class EmailCampaignsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(emailTo, "SendTestEmail")
+ body: ObjectSerializer.serialize(sendTestEmail, "SendTestEmail")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -915,9 +883,9 @@ export class EmailCampaignsApi {
*
* @summary Update an email campaign status
* @param campaignId Id of the campaign
- * @param status Status of the campaign
+ * @param updateCampaignStatus Status of the campaign
*/
- public async updateCampaignStatus (campaignId: number, status: UpdateCampaignStatus, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async updateCampaignStatus (campaignId: number, updateCampaignStatus: UpdateCampaignStatus, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/emailCampaigns/{campaignId}/status'
.replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId)));
let localVarQueryParameters: any = {};
@@ -936,9 +904,9 @@ export class EmailCampaignsApi {
throw new Error('Required parameter campaignId was null or undefined when calling updateCampaignStatus.');
}
- // verify required parameter 'status' is not null or undefined
- if (status === null || status === undefined) {
- throw new Error('Required parameter status was null or undefined when calling updateCampaignStatus.');
+ // verify required parameter 'updateCampaignStatus' is not null or undefined
+ if (updateCampaignStatus === null || updateCampaignStatus === undefined) {
+ throw new Error('Required parameter updateCampaignStatus was null or undefined when calling updateCampaignStatus.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -952,15 +920,12 @@ export class EmailCampaignsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(status, "UpdateCampaignStatus")
+ body: ObjectSerializer.serialize(updateCampaignStatus, "UpdateCampaignStatus")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -996,9 +961,9 @@ export class EmailCampaignsApi {
*
* @summary Update an email campaign
* @param campaignId Id of the campaign
- * @param emailCampaign Values to update a campaign
+ * @param updateEmailCampaign Values to update a campaign
*/
- public async updateEmailCampaign (campaignId: number, emailCampaign: UpdateEmailCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async updateEmailCampaign (campaignId: number, updateEmailCampaign: UpdateEmailCampaign, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/emailCampaigns/{campaignId}'
.replace('{' + 'campaignId' + '}', encodeURIComponent(String(campaignId)));
let localVarQueryParameters: any = {};
@@ -1017,9 +982,9 @@ export class EmailCampaignsApi {
throw new Error('Required parameter campaignId was null or undefined when calling updateEmailCampaign.');
}
- // verify required parameter 'emailCampaign' is not null or undefined
- if (emailCampaign === null || emailCampaign === undefined) {
- throw new Error('Required parameter emailCampaign was null or undefined when calling updateEmailCampaign.');
+ // verify required parameter 'updateEmailCampaign' is not null or undefined
+ if (updateEmailCampaign === null || updateEmailCampaign === undefined) {
+ throw new Error('Required parameter updateEmailCampaign was null or undefined when calling updateEmailCampaign.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -1033,15 +998,12 @@ export class EmailCampaignsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(emailCampaign, "UpdateEmailCampaign")
+ body: ObjectSerializer.serialize(updateEmailCampaign, "UpdateEmailCampaign")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1076,9 +1038,9 @@ export class EmailCampaignsApi {
/**
*
* @summary Upload an image to your account\'s image gallery
- * @param uploadImage Parameters to upload an image
+ * @param uploadImageToGallery Parameters to upload an image
*/
- public async uploadImageToGallery (uploadImage: UploadImageToGallery, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: UploadImageModel; }> {
+ public async uploadImageToGallery (uploadImageToGallery: UploadImageToGallery, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: UploadImageModel; }> {
const localVarPath = this.basePath + '/emailCampaigns/images';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -1091,9 +1053,9 @@ export class EmailCampaignsApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'uploadImage' is not null or undefined
- if (uploadImage === null || uploadImage === undefined) {
- throw new Error('Required parameter uploadImage was null or undefined when calling uploadImageToGallery.');
+ // verify required parameter 'uploadImageToGallery' is not null or undefined
+ if (uploadImageToGallery === null || uploadImageToGallery === undefined) {
+ throw new Error('Required parameter uploadImageToGallery was null or undefined when calling uploadImageToGallery.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -1107,15 +1069,12 @@ export class EmailCampaignsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(uploadImage, "UploadImageToGallery")
+ body: ObjectSerializer.serialize(uploadImageToGallery, "UploadImageToGallery")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/eventsApi.ts b/api/eventApi.ts
similarity index 90%
rename from api/eventsApi.ts
rename to api/eventApi.ts
index b0c6e2e..f6d35ab 100644
--- a/api/eventsApi.ts
+++ b/api/eventApi.ts
@@ -29,20 +29,18 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// This file is autogenerated - Please do not edit
// ===============================================
-export enum EventsApiApiKeys {
- apiKey,
- partnerKey,
+export enum EventApiApiKeys {
+ api-key,
}
-export class EventsApi {
+export class EventApi {
protected _basePath = defaultBasePath;
protected _defaultHeaders : any = {};
protected _useQuerystring : boolean = false;
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -84,8 +82,8 @@ export class EventsApi {
this.authentications.default = auth;
}
- public setApiKey(key: EventsApiApiKeys, value: string) {
- (this.authentications as any)[EventsApiApiKeys[key]].apiKey = value;
+ public setApiKey(key: EventApiApiKeys, value: string) {
+ (this.authentications as any)[EventApiApiKeys[key]].apiKey = value;
}
public addInterceptor(interceptor: Interceptor) {
@@ -130,11 +128,8 @@ export class EventsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/externalFeedsApi.ts b/api/externalFeedsApi.ts
index bd4c5de..ce26480 100644
--- a/api/externalFeedsApi.ts
+++ b/api/externalFeedsApi.ts
@@ -34,8 +34,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum ExternalFeedsApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class ExternalFeedsApi {
@@ -45,8 +44,7 @@ export class ExternalFeedsApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -134,11 +132,8 @@ export class ExternalFeedsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -209,11 +204,8 @@ export class ExternalFeedsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -311,11 +303,8 @@ export class ExternalFeedsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -386,11 +375,8 @@ export class ExternalFeedsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -468,11 +454,8 @@ export class ExternalFeedsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/filesApi.ts b/api/filesApi.ts
index bbcec54..f21910a 100644
--- a/api/filesApi.ts
+++ b/api/filesApi.ts
@@ -31,8 +31,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum FilesApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class FilesApi {
@@ -42,8 +41,7 @@ export class FilesApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -159,11 +157,8 @@ export class FilesApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -234,11 +229,8 @@ export class FilesApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -309,11 +301,8 @@ export class FilesApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -383,11 +372,8 @@ export class FilesApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -424,9 +410,9 @@ export class FilesApi {
*
* @summary Upload a file
* @param file File data to create a file.
- * @param dealId Deal id linked to a file
- * @param contactId Contact id linked to a file
- * @param companyId Company id linked to a file
+ * @param dealId
+ * @param contactId
+ * @param companyId
*/
public async crmFilesPost (file: RequestFile, dealId?: string, contactId?: number, companyId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: FileData; }> {
const localVarPath = this.basePath + '/crm/files';
@@ -477,11 +463,8 @@ export class FilesApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/inboundParsingApi.ts b/api/inboundParsingApi.ts
index 7a56330..1ee35ca 100644
--- a/api/inboundParsingApi.ts
+++ b/api/inboundParsingApi.ts
@@ -31,8 +31,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum InboundParsingApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class InboundParsingApi {
@@ -42,8 +41,7 @@ export class InboundParsingApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -103,7 +101,7 @@ export class InboundParsingApi {
.replace('{' + 'downloadToken' + '}', encodeURIComponent(String(downloadToken)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json'];
+ const produces = ['application/octet-stream', 'application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
@@ -131,11 +129,8 @@ export class InboundParsingApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -229,11 +224,8 @@ export class InboundParsingApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -304,11 +296,8 @@ export class InboundParsingApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/masterAccountApi.ts b/api/masterAccountApi.ts
index fff96f9..b11998d 100644
--- a/api/masterAccountApi.ts
+++ b/api/masterAccountApi.ts
@@ -16,13 +16,18 @@ import http from 'http';
/* tslint:disable:no-unused-locals */
import { CorporateGroupDetailsResponse } from '../model/corporateGroupDetailsResponse';
+import { CorporateGroupIdPutRequest } from '../model/corporateGroupIdPutRequest';
import { CorporateGroupPost201Response } from '../model/corporateGroupPost201Response';
import { CorporateGroupPostRequest } from '../model/corporateGroupPostRequest';
import { CorporateGroupUnlinkGroupIdSubAccountsPutRequest } from '../model/corporateGroupUnlinkGroupIdSubAccountsPutRequest';
+import { CorporateIpGet200ResponseInner } from '../model/corporateIpGet200ResponseInner';
+import { CorporateSsoTokenPostRequest } from '../model/corporateSsoTokenPostRequest';
import { CorporateSubAccountIpAssociatePostRequest } from '../model/corporateSubAccountIpAssociatePostRequest';
import { CorporateSubAccountIpDissociatePutRequest } from '../model/corporateSubAccountIpDissociatePutRequest';
+import { CorporateSubAccountKeyPostRequest } from '../model/corporateSubAccountKeyPostRequest';
+import { CorporateSubAccountSsoTokenPostRequest } from '../model/corporateSubAccountSsoTokenPostRequest';
+import { CorporateUserEmailPermissionsPutRequest } from '../model/corporateUserEmailPermissionsPutRequest';
import { CorporateUserInvitationActionEmailPut200Response } from '../model/corporateUserInvitationActionEmailPut200Response';
-import { CreateApiKeyRequest } from '../model/createApiKeyRequest';
import { CreateApiKeyResponse } from '../model/createApiKeyResponse';
import { CreateSubAccount } from '../model/createSubAccount';
import { CreateSubAccountResponse } from '../model/createSubAccountResponse';
@@ -34,12 +39,11 @@ import { GetSsoToken } from '../model/getSsoToken';
import { GetSubAccountGroups200ResponseInner } from '../model/getSubAccountGroups200ResponseInner';
import { InviteAdminUser } from '../model/inviteAdminUser';
import { MasterDetailsResponse } from '../model/masterDetailsResponse';
-import { SsoTokenRequest } from '../model/ssoTokenRequest';
-import { SsoTokenRequestCorporate } from '../model/ssoTokenRequestCorporate';
import { SubAccountAppsToggleRequest } from '../model/subAccountAppsToggleRequest';
import { SubAccountDetailsResponse } from '../model/subAccountDetailsResponse';
import { SubAccountUpdatePlanRequest } from '../model/subAccountUpdatePlanRequest';
import { SubAccountsResponse } from '../model/subAccountsResponse';
+import { SubAccountsUpdatePlanRequest } from '../model/subAccountsUpdatePlanRequest';
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
@@ -53,8 +57,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum MasterAccountApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class MasterAccountApi {
@@ -64,8 +67,7 @@ export class MasterAccountApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -153,11 +155,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -227,11 +226,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -265,12 +261,12 @@ export class MasterAccountApi {
});
}
/**
- * This endpoint allows you to update a group of sub-accounts
+ * This endpoint allows to update a group of sub-accounts
* @summary Update a group of sub-accounts
* @param id Id of the group
- * @param body Group details to be updated.
+ * @param corporateGroupIdPutRequest Group details to be updated.
*/
- public async corporateGroupIdPut (id: string, body: CorporateGroupPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async corporateGroupIdPut (id: string, corporateGroupIdPutRequest: CorporateGroupIdPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/corporate/group/{id}'
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
@@ -289,9 +285,9 @@ export class MasterAccountApi {
throw new Error('Required parameter id was null or undefined when calling corporateGroupIdPut.');
}
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling corporateGroupIdPut.');
+ // verify required parameter 'corporateGroupIdPutRequest' is not null or undefined
+ if (corporateGroupIdPutRequest === null || corporateGroupIdPutRequest === undefined) {
+ throw new Error('Required parameter corporateGroupIdPutRequest was null or undefined when calling corporateGroupIdPut.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -305,15 +301,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "CorporateGroupPostRequest")
+ body: ObjectSerializer.serialize(corporateGroupIdPutRequest, "CorporateGroupIdPutRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -347,10 +340,10 @@ export class MasterAccountApi {
}
/**
* This endpoint allows to create a group of sub-accounts
- * @summary Create a new group of sub-accounts
- * @param body Group details to be created.
+ * @summary Create a group of sub-accounts
+ * @param corporateGroupPostRequest
*/
- public async corporateGroupPost (body: CorporateGroupPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CorporateGroupPost201Response; }> {
+ public async corporateGroupPost (corporateGroupPostRequest?: CorporateGroupPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CorporateGroupPost201Response; }> {
const localVarPath = this.basePath + '/corporate/group';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -363,11 +356,6 @@ export class MasterAccountApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling corporateGroupPost.');
- }
-
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -379,15 +367,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "CorporateGroupPostRequest")
+ body: ObjectSerializer.serialize(corporateGroupPostRequest, "CorporateGroupPostRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -423,10 +408,10 @@ export class MasterAccountApi {
/**
* This endpoint allows you to remove a sub-organization from a group.
* @summary Delete sub-account from group
- * @param groupId Id of the group
- * @param body List of sub-account ids
+ * @param groupId Group id
+ * @param corporateGroupUnlinkGroupIdSubAccountsPutRequest List of sub-account ids
*/
- public async corporateGroupUnlinkGroupIdSubAccountsPut (groupId: string, body: CorporateGroupUnlinkGroupIdSubAccountsPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async corporateGroupUnlinkGroupIdSubAccountsPut (groupId: string, corporateGroupUnlinkGroupIdSubAccountsPutRequest: CorporateGroupUnlinkGroupIdSubAccountsPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/corporate/group/unlink/{groupId}/subAccounts'
.replace('{' + 'groupId' + '}', encodeURIComponent(String(groupId)));
let localVarQueryParameters: any = {};
@@ -445,9 +430,9 @@ export class MasterAccountApi {
throw new Error('Required parameter groupId was null or undefined when calling corporateGroupUnlinkGroupIdSubAccountsPut.');
}
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling corporateGroupUnlinkGroupIdSubAccountsPut.');
+ // verify required parameter 'corporateGroupUnlinkGroupIdSubAccountsPutRequest' is not null or undefined
+ if (corporateGroupUnlinkGroupIdSubAccountsPutRequest === null || corporateGroupUnlinkGroupIdSubAccountsPutRequest === undefined) {
+ throw new Error('Required parameter corporateGroupUnlinkGroupIdSubAccountsPutRequest was null or undefined when calling corporateGroupUnlinkGroupIdSubAccountsPut.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -461,15 +446,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "CorporateGroupUnlinkGroupIdSubAccountsPutRequest")
+ body: ObjectSerializer.serialize(corporateGroupUnlinkGroupIdSubAccountsPutRequest, "CorporateGroupUnlinkGroupIdSubAccountsPutRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -501,6 +483,71 @@ export class MasterAccountApi {
});
});
}
+ /**
+ * This endpoint allows you to retrieve the list of active IPs on your Admin account
+ * @summary List of all IPs
+ */
+ public async corporateIpGet (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array; }> {
+ const localVarPath = this.basePath + '/corporate/ip';
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'GET',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: Array; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "Array");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
/**
* This endpoint will provide the details of the master account.
* @summary Get the details of requested master account
@@ -532,11 +579,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -572,9 +616,9 @@ export class MasterAccountApi {
/**
* This endpoint generates an SSO token to authenticate and access the admin account using the endpoint https://account-app.brevo.com/account/login/corporate/sso/[token], where [token] will be replaced by the actual token.
* @summary Generate SSO token to access admin account
- * @param ssoTokenRequestCorporate User email of admin account
+ * @param corporateSsoTokenPostRequest
*/
- public async corporateSsoTokenPost (ssoTokenRequestCorporate: SsoTokenRequestCorporate, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> {
+ public async corporateSsoTokenPost (corporateSsoTokenPostRequest?: CorporateSsoTokenPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> {
const localVarPath = this.basePath + '/corporate/ssoToken';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -587,11 +631,6 @@ export class MasterAccountApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'ssoTokenRequestCorporate' is not null or undefined
- if (ssoTokenRequestCorporate === null || ssoTokenRequestCorporate === undefined) {
- throw new Error('Required parameter ssoTokenRequestCorporate was null or undefined when calling corporateSsoTokenPost.');
- }
-
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -603,15 +642,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(ssoTokenRequestCorporate, "SsoTokenRequestCorporate")
+ body: ObjectSerializer.serialize(corporateSsoTokenPostRequest, "CorporateSsoTokenPostRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -695,11 +731,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -733,12 +766,12 @@ export class MasterAccountApi {
});
}
/**
- * API endpoint for the Corporate owner to enable/disable applications on the sub-account
+ * API endpoints for the Corporate owner to enable/disable applications on the sub-account
* @summary Enable/disable sub-account application(s)
* @param id Id of the sub-account organization (mandatory)
- * @param toggleApplications List of applications to activate or deactivate on a sub-account
+ * @param subAccountAppsToggleRequest List of applications to activate or deactivate on a sub-account
*/
- public async corporateSubAccountIdApplicationsTogglePut (id: number, toggleApplications: SubAccountAppsToggleRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async corporateSubAccountIdApplicationsTogglePut (id: number, subAccountAppsToggleRequest: SubAccountAppsToggleRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/corporate/subAccount/{id}/applications/toggle'
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
@@ -757,9 +790,9 @@ export class MasterAccountApi {
throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdApplicationsTogglePut.');
}
- // verify required parameter 'toggleApplications' is not null or undefined
- if (toggleApplications === null || toggleApplications === undefined) {
- throw new Error('Required parameter toggleApplications was null or undefined when calling corporateSubAccountIdApplicationsTogglePut.');
+ // verify required parameter 'subAccountAppsToggleRequest' is not null or undefined
+ if (subAccountAppsToggleRequest === null || subAccountAppsToggleRequest === undefined) {
+ throw new Error('Required parameter subAccountAppsToggleRequest was null or undefined when calling corporateSubAccountIdApplicationsTogglePut.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -773,15 +806,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(toggleApplications, "SubAccountAppsToggleRequest")
+ body: ObjectSerializer.serialize(subAccountAppsToggleRequest, "SubAccountAppsToggleRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -851,11 +881,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -925,11 +952,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -966,9 +990,9 @@ export class MasterAccountApi {
* This endpoint will update the sub-account plan. On the Corporate solution new version v2, you can set an unlimited number of credits in your sub-organization. Please pass the value “-1\" to set the consumable in unlimited mode.
* @summary Update sub-account plan
* @param id Id of the sub-account organization
- * @param updatePlanDetails Values to update a sub-account plan
+ * @param subAccountUpdatePlanRequest Values to update a sub-account plan
*/
- public async corporateSubAccountIdPlanPut (id: number, updatePlanDetails: SubAccountUpdatePlanRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async corporateSubAccountIdPlanPut (id: number, subAccountUpdatePlanRequest: SubAccountUpdatePlanRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/corporate/subAccount/{id}/plan'
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
@@ -987,9 +1011,9 @@ export class MasterAccountApi {
throw new Error('Required parameter id was null or undefined when calling corporateSubAccountIdPlanPut.');
}
- // verify required parameter 'updatePlanDetails' is not null or undefined
- if (updatePlanDetails === null || updatePlanDetails === undefined) {
- throw new Error('Required parameter updatePlanDetails was null or undefined when calling corporateSubAccountIdPlanPut.');
+ // verify required parameter 'subAccountUpdatePlanRequest' is not null or undefined
+ if (subAccountUpdatePlanRequest === null || subAccountUpdatePlanRequest === undefined) {
+ throw new Error('Required parameter subAccountUpdatePlanRequest was null or undefined when calling corporateSubAccountIdPlanPut.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -1003,15 +1027,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(updatePlanDetails, "SubAccountUpdatePlanRequest")
+ body: ObjectSerializer.serialize(subAccountUpdatePlanRequest, "SubAccountUpdatePlanRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1046,9 +1067,9 @@ export class MasterAccountApi {
/**
* This endpoint allows to associate an IP to sub-accounts
* @summary Associate an IP to sub-accounts
- * @param body Ip address association details
+ * @param corporateSubAccountIpAssociatePostRequest
*/
- public async corporateSubAccountIpAssociatePost (body: CorporateSubAccountIpAssociatePostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
+ public async corporateSubAccountIpAssociatePost (corporateSubAccountIpAssociatePostRequest?: CorporateSubAccountIpAssociatePostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: object; }> {
const localVarPath = this.basePath + '/corporate/subAccount/ip/associate';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -1061,11 +1082,6 @@ export class MasterAccountApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling corporateSubAccountIpAssociatePost.');
- }
-
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -1077,15 +1093,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "CorporateSubAccountIpAssociatePostRequest")
+ body: ObjectSerializer.serialize(corporateSubAccountIpAssociatePostRequest, "CorporateSubAccountIpAssociatePostRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1120,10 +1133,10 @@ export class MasterAccountApi {
}
/**
* This endpoint allows to dissociate an IP from sub-accounts
- * @summary Dissociate an IP from sub-accounts
- * @param body Ip address dissociation details
+ * @summary Dissociate an IP to sub-accounts
+ * @param corporateSubAccountIpDissociatePutRequest
*/
- public async corporateSubAccountIpDissociatePut (body: CorporateSubAccountIpDissociatePutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async corporateSubAccountIpDissociatePut (corporateSubAccountIpDissociatePutRequest?: CorporateSubAccountIpDissociatePutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/corporate/subAccount/ip/dissociate';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -1136,11 +1149,6 @@ export class MasterAccountApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling corporateSubAccountIpDissociatePut.');
- }
-
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -1152,15 +1160,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "CorporateSubAccountIpDissociatePutRequest")
+ body: ObjectSerializer.serialize(corporateSubAccountIpDissociatePutRequest, "CorporateSubAccountIpDissociatePutRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1195,9 +1200,9 @@ export class MasterAccountApi {
/**
* This endpoint will generate an API v3 key for a sub account
* @summary Create an API key for a sub-account
- * @param createApiKeyRequest Values to generate API key for sub-account
+ * @param corporateSubAccountKeyPostRequest
*/
- public async corporateSubAccountKeyPost (createApiKeyRequest: CreateApiKeyRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateApiKeyResponse; }> {
+ public async corporateSubAccountKeyPost (corporateSubAccountKeyPostRequest?: CorporateSubAccountKeyPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateApiKeyResponse; }> {
const localVarPath = this.basePath + '/corporate/subAccount/key';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -1210,11 +1215,6 @@ export class MasterAccountApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'createApiKeyRequest' is not null or undefined
- if (createApiKeyRequest === null || createApiKeyRequest === undefined) {
- throw new Error('Required parameter createApiKeyRequest was null or undefined when calling corporateSubAccountKeyPost.');
- }
-
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -1226,15 +1226,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(createApiKeyRequest, "CreateApiKeyRequest")
+ body: ObjectSerializer.serialize(corporateSubAccountKeyPostRequest, "CorporateSubAccountKeyPostRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1270,9 +1267,9 @@ export class MasterAccountApi {
/**
* This endpoint will create a new sub-account under a master account
* @summary Create a new sub-account under a master account.
- * @param subAccountCreate values to create new sub-account
+ * @param createSubAccount Request body with sub-account organization name
*/
- public async corporateSubAccountPost (subAccountCreate: CreateSubAccount, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateSubAccountResponse; }> {
+ public async corporateSubAccountPost (createSubAccount: CreateSubAccount, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateSubAccountResponse; }> {
const localVarPath = this.basePath + '/corporate/subAccount';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -1285,9 +1282,9 @@ export class MasterAccountApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'subAccountCreate' is not null or undefined
- if (subAccountCreate === null || subAccountCreate === undefined) {
- throw new Error('Required parameter subAccountCreate was null or undefined when calling corporateSubAccountPost.');
+ // verify required parameter 'createSubAccount' is not null or undefined
+ if (createSubAccount === null || createSubAccount === undefined) {
+ throw new Error('Required parameter createSubAccount was null or undefined when calling corporateSubAccountPost.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -1301,15 +1298,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(subAccountCreate, "CreateSubAccount")
+ body: ObjectSerializer.serialize(createSubAccount, "CreateSubAccount")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1345,9 +1339,9 @@ export class MasterAccountApi {
/**
* This endpoint generates an sso token to authenticate and access a sub-account of the master using the account endpoint https://account-app.brevo.com/account/login/sub-account/sso/[token], where [token] will be replaced by the actual token.
* @summary Generate SSO token to access sub-account
- * @param ssoTokenRequest Values to generate SSO token for sub-account
+ * @param corporateSubAccountSsoTokenPostRequest
*/
- public async corporateSubAccountSsoTokenPost (ssoTokenRequest: SsoTokenRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> {
+ public async corporateSubAccountSsoTokenPost (corporateSubAccountSsoTokenPostRequest?: CorporateSubAccountSsoTokenPostRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetSsoToken; }> {
const localVarPath = this.basePath + '/corporate/subAccount/ssoToken';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -1360,11 +1354,6 @@ export class MasterAccountApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'ssoTokenRequest' is not null or undefined
- if (ssoTokenRequest === null || ssoTokenRequest === undefined) {
- throw new Error('Required parameter ssoTokenRequest was null or undefined when calling corporateSubAccountSsoTokenPost.');
- }
-
(Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
@@ -1376,15 +1365,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(ssoTokenRequest, "SsoTokenRequest")
+ body: ObjectSerializer.serialize(corporateSubAccountSsoTokenPostRequest, "CorporateSubAccountSsoTokenPostRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1418,12 +1404,161 @@ export class MasterAccountApi {
});
}
/**
- * This endpoint will allow the user to: - Resend an admin user invitation - Cancel an admin user invitation
+ * This endpoint will update multiple sub-accounts plan. On the Corporate solution new version v2, you can set an unlimited number of credits in your sub-organization. Please pass the value “-1\" to set the consumable in unlimited mode.
+ * @summary Update sub-accounts plan
+ * @param subAccountsUpdatePlanRequest Values to update sub-accounts plan
+ */
+ public async corporateSubAccountsPlanPut (subAccountsUpdatePlanRequest: SubAccountsUpdatePlanRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ const localVarPath = this.basePath + '/corporate/subAccounts/plan';
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'subAccountsUpdatePlanRequest' is not null or undefined
+ if (subAccountsUpdatePlanRequest === null || subAccountsUpdatePlanRequest === undefined) {
+ throw new Error('Required parameter subAccountsUpdatePlanRequest was null or undefined when calling corporateSubAccountsPlanPut.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'PUT',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(subAccountsUpdatePlanRequest, "SubAccountsUpdatePlanRequest")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * This endpoint will allow you to change the permissions of Admin users of your Admin account
+ * @summary Change admin user permissions
+ * @param email Email address of Admin user
+ * @param corporateUserEmailPermissionsPutRequest Values to update an admin user permissions
+ */
+ public async corporateUserEmailPermissionsPut (email: string, corporateUserEmailPermissionsPutRequest: CorporateUserEmailPermissionsPutRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ const localVarPath = this.basePath + '/corporate/user/{email}/permissions'
+ .replace('{' + 'email' + '}', encodeURIComponent(String(email)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'email' is not null or undefined
+ if (email === null || email === undefined) {
+ throw new Error('Required parameter email was null or undefined when calling corporateUserEmailPermissionsPut.');
+ }
+
+ // verify required parameter 'corporateUserEmailPermissionsPutRequest' is not null or undefined
+ if (corporateUserEmailPermissionsPutRequest === null || corporateUserEmailPermissionsPutRequest === undefined) {
+ throw new Error('Required parameter corporateUserEmailPermissionsPutRequest was null or undefined when calling corporateUserEmailPermissionsPut.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'PUT',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(corporateUserEmailPermissionsPutRequest, "CorporateUserEmailPermissionsPutRequest")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * This endpoint will allow the user to: - Resend an admin user invitation - Cancel an admin user invitation
* @summary Resend / cancel admin user invitation
* @param action Action to be performed (cancel / resend)
* @param email Email address of the recipient
*/
- public async corporateUserInvitationActionEmailPut (action: string, email: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CorporateUserInvitationActionEmailPut200Response; }> {
+ public async corporateUserInvitationActionEmailPut (action: 'resend' | 'cancel', email: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CorporateUserInvitationActionEmailPut200Response; }> {
const localVarPath = this.basePath + '/corporate/user/invitation/{action}/{email}'
.replace('{' + 'action' + '}', encodeURIComponent(String(action)))
.replace('{' + 'email' + '}', encodeURIComponent(String(email)));
@@ -1462,11 +1597,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1537,11 +1669,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1578,10 +1707,11 @@ export class MasterAccountApi {
* @summary Get user activity logs
* @param startDate Mandatory if endDate is used. Enter start date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month. Additionally, you can retrieve activity logs from the past 12 months from the date of your search.
* @param endDate Mandatory if startDate is used. Enter end date in UTC date (YYYY-MM-DD) format to filter the activity in your account. Maximum time period that can be selected is one month.
+ * @param email Enter the user\'s email address to filter their activity in the account.
* @param limit Number of documents per page
* @param offset Index of the first document in the page.
*/
- public async getAccountActivity (startDate?: string, endDate?: string, limit?: number, offset?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetAccountActivity; }> {
+ public async getAccountActivity (startDate?: string, endDate?: string, email?: string, limit?: number, offset?: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetAccountActivity; }> {
const localVarPath = this.basePath + '/organization/activities';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -1602,6 +1732,10 @@ export class MasterAccountApi {
localVarQueryParameters['endDate'] = ObjectSerializer.serialize(endDate, "string");
}
+ if (email !== undefined) {
+ localVarQueryParameters['email'] = ObjectSerializer.serialize(email, "string");
+ }
+
if (limit !== undefined) {
localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
}
@@ -1624,11 +1758,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1692,11 +1823,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1730,9 +1858,9 @@ export class MasterAccountApi {
});
}
/**
- *
+ * This endpoint will provide the list of admin user permissions
* @summary Check admin user permissions
- * @param email Email of the invited user
+ * @param email Email of the invited user.
*/
public async getCorporateUserPermission (email: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: GetCorporateUserPermission; }> {
const localVarPath = this.basePath + '/corporate/user/{email}/permissions'
@@ -1767,11 +1895,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1835,11 +1960,8 @@ export class MasterAccountApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1873,11 +1995,11 @@ export class MasterAccountApi {
});
}
/**
- * `This endpoint allows you to invite a member to manage the Admin account Features and their respective permissions are as below: - `my_plan`: - \"all\" - `api`: - \"none\" - `user_management`: - \"all\" - `app_management` | Not available in ENTv2: - \"all\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it\'s assumed that all permissions will be there for the invited admin user.
+ * `This endpoint allows you to invite a member to manage the Admin account Features and their respective permissions are as below: - `my_plan`: - \"all\" - `api`: - \"none\" - `user_management`: - \"all\" - `app_management` | Not available in ENTv2: - \"all\" - `sub_organization_groups` - \"create\" - \"edit_delete\" - `create_sub_organizations` - \"all\" - `manage_sub_organizations` - \"all\" - `analytics` - \"download_data\" - \"create_alerts\" - \"my_looks\" - \"explore_create\" - `security` - \"all\" **Note**: - If `all_features_access: false` then only privileges are required otherwise if `true` then it\'s assumed that all permissions will be there for the invited admin user.
* @summary Send invitation to an admin user
- * @param sendInvitation Payload to send an invitation
+ * @param inviteAdminUser Payload to send an invitation
*/
- public async inviteAdminUser (sendInvitation: InviteAdminUser, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: InviteAdminUser; }> {
+ public async inviteAdminUser (inviteAdminUser: InviteAdminUser, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CorporateGroupPost201Response; }> {
const localVarPath = this.basePath + '/corporate/user/invitation/send';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -1890,9 +2012,9 @@ export class MasterAccountApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'sendInvitation' is not null or undefined
- if (sendInvitation === null || sendInvitation === undefined) {
- throw new Error('Required parameter sendInvitation was null or undefined when calling inviteAdminUser.');
+ // verify required parameter 'inviteAdminUser' is not null or undefined
+ if (inviteAdminUser === null || inviteAdminUser === undefined) {
+ throw new Error('Required parameter inviteAdminUser was null or undefined when calling inviteAdminUser.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -1906,15 +2028,12 @@ export class MasterAccountApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(sendInvitation, "InviteAdminUser")
+ body: ObjectSerializer.serialize(inviteAdminUser, "InviteAdminUser")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -1931,13 +2050,13 @@ export class MasterAccountApi {
localVarRequestOptions.form = localVarFormParams;
}
}
- return new Promise<{ response: http.IncomingMessage; body: InviteAdminUser; }>((resolve, reject) => {
+ return new Promise<{ response: http.IncomingMessage; body: CorporateGroupPost201Response; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
- body = ObjectSerializer.deserialize(body, "InviteAdminUser");
+ body = ObjectSerializer.deserialize(body, "CorporateGroupPost201Response");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
diff --git a/api/notesApi.ts b/api/notesApi.ts
index b39f495..5323d38 100644
--- a/api/notesApi.ts
+++ b/api/notesApi.ts
@@ -32,8 +32,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum NotesApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class NotesApi {
@@ -43,8 +42,7 @@ export class NotesApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -109,7 +107,7 @@ export class NotesApi {
const localVarPath = this.basePath + '/crm/notes';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json', 'response'];
+ const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
@@ -160,11 +158,8 @@ export class NotesApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -235,11 +230,8 @@ export class NotesApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -309,11 +301,8 @@ export class NotesApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -350,9 +339,9 @@ export class NotesApi {
*
* @summary Update a note
* @param id Note ID to update
- * @param body Note data to update a note
+ * @param noteData Note data to update a note.
*/
- public async crmNotesIdPatch (id: string, body: NoteData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ public async crmNotesIdPatch (id: string, noteData: NoteData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/crm/notes/{id}'
.replace('{' + 'id' + '}', encodeURIComponent(String(id)));
let localVarQueryParameters: any = {};
@@ -371,9 +360,9 @@ export class NotesApi {
throw new Error('Required parameter id was null or undefined when calling crmNotesIdPatch.');
}
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling crmNotesIdPatch.');
+ // verify required parameter 'noteData' is not null or undefined
+ if (noteData === null || noteData === undefined) {
+ throw new Error('Required parameter noteData was null or undefined when calling crmNotesIdPatch.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -387,15 +376,12 @@ export class NotesApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "NoteData")
+ body: ObjectSerializer.serialize(noteData, "NoteData")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -430,9 +416,9 @@ export class NotesApi {
/**
*
* @summary Create a note
- * @param body Note data to create a note.
+ * @param noteData Note data to create a note.
*/
- public async crmNotesPost (body: NoteData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NoteId; }> {
+ public async crmNotesPost (noteData: NoteData, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: NoteId; }> {
const localVarPath = this.basePath + '/crm/notes';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
@@ -445,9 +431,9 @@ export class NotesApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'body' is not null or undefined
- if (body === null || body === undefined) {
- throw new Error('Required parameter body was null or undefined when calling crmNotesPost.');
+ // verify required parameter 'noteData' is not null or undefined
+ if (noteData === null || noteData === undefined) {
+ throw new Error('Required parameter noteData was null or undefined when calling crmNotesPost.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -461,15 +447,12 @@ export class NotesApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(body, "NoteData")
+ body: ObjectSerializer.serialize(noteData, "NoteData")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/paymentsApi.ts b/api/paymentsApi.ts
index 5b280db..2c0682b 100644
--- a/api/paymentsApi.ts
+++ b/api/paymentsApi.ts
@@ -32,8 +32,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum PaymentsApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class PaymentsApi {
@@ -43,8 +42,7 @@ export class PaymentsApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -97,13 +95,13 @@ export class PaymentsApi {
/**
*
* @summary Create a payment request
- * @param createPaymentRquest Create a payment request
+ * @param createPaymentRequest Create a payment request
*/
- public async createPaymentRequest (createPaymentRquest: CreatePaymentRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreatePaymentResponse; }> {
+ public async createPaymentRequest (createPaymentRequest: CreatePaymentRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreatePaymentResponse; }> {
const localVarPath = this.basePath + '/payments/requests';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
- const produces = ['application/json', 'response'];
+ const produces = ['application/json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
@@ -112,9 +110,9 @@ export class PaymentsApi {
}
let localVarFormParams: any = {};
- // verify required parameter 'createPaymentRquest' is not null or undefined
- if (createPaymentRquest === null || createPaymentRquest === undefined) {
- throw new Error('Required parameter createPaymentRquest was null or undefined when calling createPaymentRequest.');
+ // verify required parameter 'createPaymentRequest' is not null or undefined
+ if (createPaymentRequest === null || createPaymentRequest === undefined) {
+ throw new Error('Required parameter createPaymentRequest was null or undefined when calling createPaymentRequest.');
}
(Object).assign(localVarHeaderParams, options.headers);
@@ -128,15 +126,12 @@ export class PaymentsApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
- body: ObjectSerializer.serialize(createPaymentRquest, "CreatePaymentRequest")
+ body: ObjectSerializer.serialize(createPaymentRequest, "CreatePaymentRequest")
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -207,11 +202,8 @@ export class PaymentsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -281,11 +273,8 @@ export class PaymentsApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/processApi.ts b/api/processApi.ts
index cb17fcd..cd1ebf9 100644
--- a/api/processApi.ts
+++ b/api/processApi.ts
@@ -31,8 +31,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum ProcessApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class ProcessApi {
@@ -42,8 +41,7 @@ export class ProcessApi {
protected authentications = {
'default': new VoidAuth(),
- 'apiKey': new ApiKeyAuth('header', 'api-key'),
- 'partnerKey': new ApiKeyAuth('header', 'partner-key'),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
}
protected interceptors: Interceptor[] = [];
@@ -131,11 +129,8 @@ export class ProcessApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
@@ -214,11 +209,8 @@ export class ProcessApi {
};
let authenticationPromise = Promise.resolve();
- if (this.authentications.apiKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.apiKey.applyToRequest(localVarRequestOptions));
- }
- if (this.authentications.partnerKey.apiKey) {
- authenticationPromise = authenticationPromise.then(() => this.authentications.partnerKey.applyToRequest(localVarRequestOptions));
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
diff --git a/api/programApi.ts b/api/programApi.ts
new file mode 100644
index 0000000..7c3394d
--- /dev/null
+++ b/api/programApi.ts
@@ -0,0 +1,957 @@
+/**
+ * Brevo API
+ * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity |
+ *
+ * The version of the OpenAPI document: 3.0.0
+ * Contact: contact@brevo.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+import localVarRequest from 'request';
+import http from 'http';
+
+/* tslint:disable:no-unused-locals */
+import { AddSubscriptionMemberPayload } from '../model/addSubscriptionMemberPayload';
+import { CreateLoyaltyProgramPayload } from '../model/createLoyaltyProgramPayload';
+import { CreateSubscriptionPayload } from '../model/createSubscriptionPayload';
+import { ErrorResponse } from '../model/errorResponse';
+import { LoyaltyProgram } from '../model/loyaltyProgram';
+import { LoyaltyProgramPage } from '../model/loyaltyProgramPage';
+import { PatchLoyaltyProgramPayload } from '../model/patchLoyaltyProgramPayload';
+import { Subscription } from '../model/subscription';
+import { SubscriptionHandlerInfo } from '../model/subscriptionHandlerInfo';
+import { SubscriptionMember } from '../model/subscriptionMember';
+import { UpdateLoyaltyProgramPayload } from '../model/updateLoyaltyProgramPayload';
+
+import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
+import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
+
+import { HttpError, RequestFile } from './apis';
+
+let defaultBasePath = 'https://api.brevo.com/v3';
+
+// ===============================================
+// This file is autogenerated - Please do not edit
+// ===============================================
+
+export enum ProgramApiApiKeys {
+ api-key,
+}
+
+export class ProgramApi {
+ protected _basePath = defaultBasePath;
+ protected _defaultHeaders : any = {};
+ protected _useQuerystring : boolean = false;
+
+ protected authentications = {
+ 'default': new VoidAuth(),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
+ }
+
+ protected interceptors: Interceptor[] = [];
+
+ constructor(basePath?: string);
+ constructor(basePathOrUsername: string, password?: string, basePath?: string) {
+ if (password) {
+ if (basePath) {
+ this.basePath = basePath;
+ }
+ } else {
+ if (basePathOrUsername) {
+ this.basePath = basePathOrUsername
+ }
+ }
+ }
+
+ set useQuerystring(value: boolean) {
+ this._useQuerystring = value;
+ }
+
+ set basePath(basePath: string) {
+ this._basePath = basePath;
+ }
+
+ set defaultHeaders(defaultHeaders: any) {
+ this._defaultHeaders = defaultHeaders;
+ }
+
+ get defaultHeaders() {
+ return this._defaultHeaders;
+ }
+
+ get basePath() {
+ return this._basePath;
+ }
+
+ public setDefaultAuthentication(auth: Authentication) {
+ this.authentications.default = auth;
+ }
+
+ public setApiKey(key: ProgramApiApiKeys, value: string) {
+ (this.authentications as any)[ProgramApiApiKeys[key]].apiKey = value;
+ }
+
+ public addInterceptor(interceptor: Interceptor) {
+ this.interceptors.push(interceptor);
+ }
+
+ /**
+ * Creates loyalty program
+ * @summary Create loyalty program
+ * @param createLoyaltyProgramPayload Payload for creating a new loyalty program.
+ */
+ public async createNewLP (createLoyaltyProgramPayload: CreateLoyaltyProgramPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoyaltyProgram; }> {
+ const localVarPath = this.basePath + '/loyalty/config/programs';
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'createLoyaltyProgramPayload' is not null or undefined
+ if (createLoyaltyProgramPayload === null || createLoyaltyProgramPayload === undefined) {
+ throw new Error('Required parameter createLoyaltyProgramPayload was null or undefined when calling createNewLP.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(createLoyaltyProgramPayload, "CreateLoyaltyProgramPayload")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: LoyaltyProgram; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "LoyaltyProgram");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Deletes member from a subscription
+ * @summary Delete subscription member
+ * @param pid Loyalty Program ID. A unique identifier for the loyalty program.
+ * @param memberContactIds Comma-separated list of member contact IDs to delete from the subscription.
+ */
+ public async deleteContactMembers (pid: string, memberContactIds: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ const localVarPath = this.basePath + '/loyalty/config/programs/{pid}/subscription-members'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling deleteContactMembers.');
+ }
+
+ // verify required parameter 'memberContactIds' is not null or undefined
+ if (memberContactIds === null || memberContactIds === undefined) {
+ throw new Error('Required parameter memberContactIds was null or undefined when calling deleteContactMembers.');
+ }
+
+ if (memberContactIds !== undefined) {
+ localVarQueryParameters['memberContactIds'] = ObjectSerializer.serialize(memberContactIds, "string");
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'DELETE',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Deletes Loyalty Program
+ * @summary Delete Loyalty Program
+ * @param pid Loyalty Program ID. A unique identifier for the loyalty program.
+ */
+ public async deleteLoyaltyProgram (pid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ const localVarPath = this.basePath + '/loyalty/config/programs/{pid}'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling deleteLoyaltyProgram.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'DELETE',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Returns list of loyalty programs
+ * @summary Get loyalty program list
+ * @param limit Number of documents per page
+ * @param offset Index of the first document in the page
+ * @param sortField Sort documents by field
+ * @param sort Sort documents by field
+ */
+ public async getLPList (limit?: number, offset?: number, sortField?: 'name' | 'created_at' | 'updated_at', sort?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoyaltyProgramPage; }> {
+ const localVarPath = this.basePath + '/loyalty/config/programs';
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ if (limit !== undefined) {
+ localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
+ }
+
+ if (offset !== undefined) {
+ localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number");
+ }
+
+ if (sortField !== undefined) {
+ localVarQueryParameters['sort_field'] = ObjectSerializer.serialize(sortField, "'name' | 'created_at' | 'updated_at'");
+ }
+
+ if (sort !== undefined) {
+ localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "string");
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'GET',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: LoyaltyProgramPage; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "LoyaltyProgramPage");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Returns loyalty program
+ * @summary Get loyalty program Info
+ * @param pid Loyalty Program ID. A unique identifier for the loyalty program.
+ */
+ public async getLoyaltyProgramInfo (pid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoyaltyProgram; }> {
+ const localVarPath = this.basePath + '/loyalty/config/programs/{pid}'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling getLoyaltyProgramInfo.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'GET',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: LoyaltyProgram; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "LoyaltyProgram");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Get Information of balances, tiers, rewards and subscription members for a subscription
+ * @summary Get Subscription Data
+ * @param pid Loyalty Program ID. A unique identifier for the loyalty program.
+ * @param contactId The contact ID to filter by.
+ * @param params A list of filter parameters for querying the subscription info.
+ * @param loyaltySubscriptionId The loyalty subscription ID to filter by.
+ */
+ public async getParameterSubscriptionInfo (pid: string, contactId?: string, params?: string, loyaltySubscriptionId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SubscriptionHandlerInfo; }> {
+ const localVarPath = this.basePath + '/loyalty/config/programs/{pid}/account-info'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling getParameterSubscriptionInfo.');
+ }
+
+ if (contactId !== undefined) {
+ localVarQueryParameters['contactId'] = ObjectSerializer.serialize(contactId, "string");
+ }
+
+ if (params !== undefined) {
+ localVarQueryParameters['params'] = ObjectSerializer.serialize(params, "string");
+ }
+
+ if (loyaltySubscriptionId !== undefined) {
+ localVarQueryParameters['loyaltySubscriptionId'] = ObjectSerializer.serialize(loyaltySubscriptionId, "string");
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'GET',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: SubscriptionHandlerInfo; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "SubscriptionHandlerInfo");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Partially updates loyalty program
+ * @summary Partially update loyalty program
+ * @param pid Loyalty Program ID. A unique identifier for the loyalty program.
+ * @param patchLoyaltyProgramPayload Loyalty Program Payload
+ */
+ public async partiallyUpdateLoyaltyProgram (pid: string, patchLoyaltyProgramPayload: PatchLoyaltyProgramPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoyaltyProgram; }> {
+ const localVarPath = this.basePath + '/loyalty/config/programs/{pid}'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling partiallyUpdateLoyaltyProgram.');
+ }
+
+ // verify required parameter 'patchLoyaltyProgramPayload' is not null or undefined
+ if (patchLoyaltyProgramPayload === null || patchLoyaltyProgramPayload === undefined) {
+ throw new Error('Required parameter patchLoyaltyProgramPayload was null or undefined when calling partiallyUpdateLoyaltyProgram.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'PATCH',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(patchLoyaltyProgramPayload, "PatchLoyaltyProgramPayload")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: LoyaltyProgram; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "LoyaltyProgram");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Publishes loyalty program
+ * @summary Publish loyalty program
+ * @param pid Loyalty Program ID. A unique identifier for the loyalty program.
+ */
+ public async publishLoyaltyProgram (pid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ const localVarPath = this.basePath + '/loyalty/config/programs/{pid}/publish'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling publishLoyaltyProgram.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Add member to a subscription
+ * @summary Create subscription member
+ * @param pid Loyalty Program ID. A unique identifier for the loyalty program.
+ * @param addSubscriptionMemberPayload Payload for adding a subscription member.
+ */
+ public async subscribeMemberToASubscription (pid: string, addSubscriptionMemberPayload: AddSubscriptionMemberPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: SubscriptionMember; }> {
+ const localVarPath = this.basePath + '/loyalty/config/programs/{pid}/subscription-members'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling subscribeMemberToASubscription.');
+ }
+
+ // verify required parameter 'addSubscriptionMemberPayload' is not null or undefined
+ if (addSubscriptionMemberPayload === null || addSubscriptionMemberPayload === undefined) {
+ throw new Error('Required parameter addSubscriptionMemberPayload was null or undefined when calling subscribeMemberToASubscription.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(addSubscriptionMemberPayload, "AddSubscriptionMemberPayload")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: SubscriptionMember; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "SubscriptionMember");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Subscribes to a loyalty program
+ * @summary Create subscription
+ * @param pid Loyalty Program ID. A unique identifier for the loyalty program.
+ * @param createSubscriptionPayload Create Subscription Payload
+ */
+ public async subscribeToLoyaltyProgram (pid: string, createSubscriptionPayload: CreateSubscriptionPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Subscription; }> {
+ const localVarPath = this.basePath + '/loyalty/config/programs/{pid}/subscriptions'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling subscribeToLoyaltyProgram.');
+ }
+
+ // verify required parameter 'createSubscriptionPayload' is not null or undefined
+ if (createSubscriptionPayload === null || createSubscriptionPayload === undefined) {
+ throw new Error('Required parameter createSubscriptionPayload was null or undefined when calling subscribeToLoyaltyProgram.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(createSubscriptionPayload, "CreateSubscriptionPayload")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: Subscription; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "Subscription");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Updates loyalty program
+ * @summary Update loyalty program
+ * @param pid Loyalty Program ID. A unique identifier for the loyalty program.
+ * @param updateLoyaltyProgramPayload Update Loyalty Program Payload
+ */
+ public async updateLoyaltyProgram (pid: string, updateLoyaltyProgramPayload: UpdateLoyaltyProgramPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: LoyaltyProgram; }> {
+ const localVarPath = this.basePath + '/loyalty/config/programs/{pid}'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling updateLoyaltyProgram.');
+ }
+
+ // verify required parameter 'updateLoyaltyProgramPayload' is not null or undefined
+ if (updateLoyaltyProgramPayload === null || updateLoyaltyProgramPayload === undefined) {
+ throw new Error('Required parameter updateLoyaltyProgramPayload was null or undefined when calling updateLoyaltyProgram.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'PUT',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(updateLoyaltyProgramPayload, "UpdateLoyaltyProgramPayload")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: LoyaltyProgram; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "LoyaltyProgram");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+}
diff --git a/api/rewardApi.ts b/api/rewardApi.ts
new file mode 100644
index 0000000..310df83
--- /dev/null
+++ b/api/rewardApi.ts
@@ -0,0 +1,942 @@
+/**
+ * Brevo API
+ * Brevo provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/brevo **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable | | 422 | Error. Unprocessable Entity |
+ *
+ * The version of the OpenAPI document: 3.0.0
+ * Contact: contact@brevo.com
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+
+
+import localVarRequest from 'request';
+import http from 'http';
+
+/* tslint:disable:no-unused-locals */
+import { MainAttributeRewardPayload } from '../model/mainAttributeRewardPayload';
+import { MainCodeCountHttpResponse } from '../model/mainCodeCountHttpResponse';
+import { MainCreateRedeemPayload } from '../model/mainCreateRedeemPayload';
+import { MainCreateRewardPayload } from '../model/mainCreateRewardPayload';
+import { MainCreateRewardResponse } from '../model/mainCreateRewardResponse';
+import { MainErrorResponse } from '../model/mainErrorResponse';
+import { MainModelContactRewardsResp } from '../model/mainModelContactRewardsResp';
+import { MainRedeem } from '../model/mainRedeem';
+import { MainReward } from '../model/mainReward';
+import { MainRewardAttribution } from '../model/mainRewardAttribution';
+import { MainRewardPage } from '../model/mainRewardPage';
+import { MainRewardValidate } from '../model/mainRewardValidate';
+import { MainValidateRewardPayload } from '../model/mainValidateRewardPayload';
+
+import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
+import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
+
+import { HttpError, RequestFile } from './apis';
+
+let defaultBasePath = 'https://api.brevo.com/v3';
+
+// ===============================================
+// This file is autogenerated - Please do not edit
+// ===============================================
+
+export enum RewardApiApiKeys {
+ api-key,
+}
+
+export class RewardApi {
+ protected _basePath = defaultBasePath;
+ protected _defaultHeaders : any = {};
+ protected _useQuerystring : boolean = false;
+
+ protected authentications = {
+ 'default': new VoidAuth(),
+ 'api-key': new ApiKeyAuth('header', 'api-key'),
+ }
+
+ protected interceptors: Interceptor[] = [];
+
+ constructor(basePath?: string);
+ constructor(basePathOrUsername: string, password?: string, basePath?: string) {
+ if (password) {
+ if (basePath) {
+ this.basePath = basePath;
+ }
+ } else {
+ if (basePathOrUsername) {
+ this.basePath = basePathOrUsername
+ }
+ }
+ }
+
+ set useQuerystring(value: boolean) {
+ this._useQuerystring = value;
+ }
+
+ set basePath(basePath: string) {
+ this._basePath = basePath;
+ }
+
+ set defaultHeaders(defaultHeaders: any) {
+ this._defaultHeaders = defaultHeaders;
+ }
+
+ get defaultHeaders() {
+ return this._defaultHeaders;
+ }
+
+ get basePath() {
+ return this._basePath;
+ }
+
+ public setDefaultAuthentication(auth: Authentication) {
+ this.authentications.default = auth;
+ }
+
+ public setApiKey(key: RewardApiApiKeys, value: string) {
+ (this.authentications as any)[RewardApiApiKeys[key]].apiKey = value;
+ }
+
+ public addInterceptor(interceptor: Interceptor) {
+ this.interceptors.push(interceptor);
+ }
+
+ /**
+ * Completes voucher redeem request.
+ * @summary Complete redeem voucher request
+ * @param pid Loyalty Program ID
+ * @param tid Redeem transaction ID
+ */
+ public async completeRedeemTransaction (pid: string, tid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MainRedeem; }> {
+ const localVarPath = this.basePath + '/loyalty/offer/programs/{pid}/rewards/redeem/{tid}/complete'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'tid' + '}', encodeURIComponent(String(tid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling completeRedeemTransaction.');
+ }
+
+ // verify required parameter 'tid' is not null or undefined
+ if (tid === null || tid === undefined) {
+ throw new Error('Required parameter tid was null or undefined when calling completeRedeemTransaction.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: MainRedeem; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "MainRedeem");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Creates a new reward in the loyalty program.
+ * @summary Create a reward
+ * @param pid Loyalty Program ID
+ * @param mainCreateRewardPayload
+ */
+ public async createReward (pid: string, mainCreateRewardPayload: MainCreateRewardPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MainCreateRewardResponse; }> {
+ const localVarPath = this.basePath + '/loyalty/offer/programs/{pid}/offers'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling createReward.');
+ }
+
+ // verify required parameter 'mainCreateRewardPayload' is not null or undefined
+ if (mainCreateRewardPayload === null || mainCreateRewardPayload === undefined) {
+ throw new Error('Required parameter mainCreateRewardPayload was null or undefined when calling createReward.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(mainCreateRewardPayload, "MainCreateRewardPayload")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: MainCreateRewardResponse; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "MainCreateRewardResponse");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Create a voucher and attribute it to a specific membership.
+ * @summary Create a voucher
+ * @param pid Loyalty Program ID
+ * @param mainAttributeRewardPayload
+ */
+ public async createVoucher (pid: string, mainAttributeRewardPayload: MainAttributeRewardPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MainRewardAttribution; }> {
+ const localVarPath = this.basePath + '/loyalty/offer/programs/{pid}/rewards/attribute'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling createVoucher.');
+ }
+
+ // verify required parameter 'mainAttributeRewardPayload' is not null or undefined
+ if (mainAttributeRewardPayload === null || mainAttributeRewardPayload === undefined) {
+ throw new Error('Required parameter mainAttributeRewardPayload was null or undefined when calling createVoucher.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(mainAttributeRewardPayload, "MainAttributeRewardPayload")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: MainRewardAttribution; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "MainRewardAttribution");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Get code count
+ * @summary Get code count
+ * @param pid Loyalty Program ID
+ * @param cpid Code Pool ID
+ */
+ public async getCodeCount (pid: string, cpid: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MainCodeCountHttpResponse; }> {
+ const localVarPath = this.basePath + '/loyalty/offer/programs/{pid}/code-pools/{cpid}/codes-count'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'cpid' + '}', encodeURIComponent(String(cpid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling getCodeCount.');
+ }
+
+ // verify required parameter 'cpid' is not null or undefined
+ if (cpid === null || cpid === undefined) {
+ throw new Error('Required parameter cpid was null or undefined when calling getCodeCount.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'GET',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: MainCodeCountHttpResponse; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "MainCodeCountHttpResponse");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Returns a reward page
+ * @summary Get Reward Page API
+ * @param pid Loyalty Program ID
+ * @param limit Page size
+ * @param offset Pagination offset
+ * @param state State of the reward
+ * @param version Version
+ */
+ public async loyaltyOfferProgramsPidOffersGet (pid: string, limit?: number, offset?: number, state?: string, version?: 'active' | 'draft', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MainRewardPage; }> {
+ const localVarPath = this.basePath + '/loyalty/offer/programs/{pid}/offers'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling loyaltyOfferProgramsPidOffersGet.');
+ }
+
+ if (limit !== undefined) {
+ localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
+ }
+
+ if (offset !== undefined) {
+ localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number");
+ }
+
+ if (state !== undefined) {
+ localVarQueryParameters['state'] = ObjectSerializer.serialize(state, "string");
+ }
+
+ if (version !== undefined) {
+ localVarQueryParameters['version'] = ObjectSerializer.serialize(version, "'active' | 'draft'");
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'GET',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: MainRewardPage; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "MainRewardPage");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Returns reward information.
+ * @summary Get reward information
+ * @param pid Loyalty Program ID
+ * @param rid Reward ID
+ * @param version Version
+ */
+ public async loyaltyOfferProgramsPidRewardsRidGet (pid: string, rid: string, version?: 'active' | 'draft', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MainReward; }> {
+ const localVarPath = this.basePath + '/loyalty/offer/programs/{pid}/rewards/{rid}'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)))
+ .replace('{' + 'rid' + '}', encodeURIComponent(String(rid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling loyaltyOfferProgramsPidRewardsRidGet.');
+ }
+
+ // verify required parameter 'rid' is not null or undefined
+ if (rid === null || rid === undefined) {
+ throw new Error('Required parameter rid was null or undefined when calling loyaltyOfferProgramsPidRewardsRidGet.');
+ }
+
+ if (version !== undefined) {
+ localVarQueryParameters['version'] = ObjectSerializer.serialize(version, "'active' | 'draft'");
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'GET',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: MainReward; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "MainReward");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Get voucher for a contact
+ * @summary Get voucher for a contact
+ * @param pid Loyalty Program ID
+ * @param contactId Contact ID
+ * @param limit Page size
+ * @param offset Pagination offset
+ * @param sort Sort order
+ * @param sortField Sort field
+ * @param metadataKeyValue Metadata value for a Key filter
+ * @param rewardId Reward ID
+ */
+ public async loyaltyOfferProgramsPidVouchersGet (pid: string, contactId: number, limit?: number, offset?: number, sort?: 'asc' | 'desc', sortField?: 'updatedAt' | 'createdAt', metadataKeyValue?: string, rewardId?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MainModelContactRewardsResp; }> {
+ const localVarPath = this.basePath + '/loyalty/offer/programs/{pid}/vouchers'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling loyaltyOfferProgramsPidVouchersGet.');
+ }
+
+ // verify required parameter 'contactId' is not null or undefined
+ if (contactId === null || contactId === undefined) {
+ throw new Error('Required parameter contactId was null or undefined when calling loyaltyOfferProgramsPidVouchersGet.');
+ }
+
+ if (limit !== undefined) {
+ localVarQueryParameters['limit'] = ObjectSerializer.serialize(limit, "number");
+ }
+
+ if (offset !== undefined) {
+ localVarQueryParameters['offset'] = ObjectSerializer.serialize(offset, "number");
+ }
+
+ if (sort !== undefined) {
+ localVarQueryParameters['sort'] = ObjectSerializer.serialize(sort, "'asc' | 'desc'");
+ }
+
+ if (sortField !== undefined) {
+ localVarQueryParameters['sortField'] = ObjectSerializer.serialize(sortField, "'updatedAt' | 'createdAt'");
+ }
+
+ if (contactId !== undefined) {
+ localVarQueryParameters['contactId'] = ObjectSerializer.serialize(contactId, "number");
+ }
+
+ if (metadataKeyValue !== undefined) {
+ localVarQueryParameters['metadata_key_value'] = ObjectSerializer.serialize(metadataKeyValue, "string");
+ }
+
+ if (rewardId !== undefined) {
+ localVarQueryParameters['rewardId'] = ObjectSerializer.serialize(rewardId, "string");
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'GET',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: MainModelContactRewardsResp; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "MainModelContactRewardsResp");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Creates a request to redeem a voucher.
+ * @summary Create redeem voucher request
+ * @param pid Loyalty Program ID
+ * @param mainCreateRedeemPayload
+ */
+ public async redeemVoucher (pid: string, mainCreateRedeemPayload: MainCreateRedeemPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MainRedeem; }> {
+ const localVarPath = this.basePath + '/loyalty/offer/programs/{pid}/rewards/redeem'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling redeemVoucher.');
+ }
+
+ // verify required parameter 'mainCreateRedeemPayload' is not null or undefined
+ if (mainCreateRedeemPayload === null || mainCreateRedeemPayload === undefined) {
+ throw new Error('Required parameter mainCreateRedeemPayload was null or undefined when calling redeemVoucher.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(mainCreateRedeemPayload, "MainCreateRedeemPayload")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: MainRedeem; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "MainRedeem");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Revoke attributed vouchers.
+ * @summary Revoke vouchers
+ * @param pid Loyalty Program ID
+ * @param attributedRewardIds Reward Attribution IDs (comma seperated)
+ */
+ public async revokeVouchers (pid: string, attributedRewardIds?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
+ const localVarPath = this.basePath + '/loyalty/offer/programs/{pid}/rewards/revoke'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling revokeVouchers.');
+ }
+
+ if (attributedRewardIds !== undefined) {
+ localVarQueryParameters['attributedRewardIds'] = ObjectSerializer.serialize(attributedRewardIds, "string");
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'DELETE',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+ /**
+ * Validates a reward.
+ * @summary Validate a reward
+ * @param pid Loyalty Program ID
+ * @param mainValidateRewardPayload
+ */
+ public async validateReward (pid: string, mainValidateRewardPayload: MainValidateRewardPayload, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: MainRewardValidate; }> {
+ const localVarPath = this.basePath + '/loyalty/offer/programs/{pid}/rewards/validate'
+ .replace('{' + 'pid' + '}', encodeURIComponent(String(pid)));
+ let localVarQueryParameters: any = {};
+ let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders);
+ const produces = ['application/json'];
+ // give precedence to 'application/json'
+ if (produces.indexOf('application/json') >= 0) {
+ localVarHeaderParams.Accept = 'application/json';
+ } else {
+ localVarHeaderParams.Accept = produces.join(',');
+ }
+ let localVarFormParams: any = {};
+
+ // verify required parameter 'pid' is not null or undefined
+ if (pid === null || pid === undefined) {
+ throw new Error('Required parameter pid was null or undefined when calling validateReward.');
+ }
+
+ // verify required parameter 'mainValidateRewardPayload' is not null or undefined
+ if (mainValidateRewardPayload === null || mainValidateRewardPayload === undefined) {
+ throw new Error('Required parameter mainValidateRewardPayload was null or undefined when calling validateReward.');
+ }
+
+ (Object).assign(localVarHeaderParams, options.headers);
+
+ let localVarUseFormData = false;
+
+ let localVarRequestOptions: localVarRequest.Options = {
+ method: 'POST',
+ qs: localVarQueryParameters,
+ headers: localVarHeaderParams,
+ uri: localVarPath,
+ useQuerystring: this._useQuerystring,
+ json: true,
+ body: ObjectSerializer.serialize(mainValidateRewardPayload, "MainValidateRewardPayload")
+ };
+
+ let authenticationPromise = Promise.resolve();
+ if (this.authentications.api-key.apiKey) {
+ authenticationPromise = authenticationPromise.then(() => this.authentications.api-key.applyToRequest(localVarRequestOptions));
+ }
+ authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
+
+ let interceptorPromise = authenticationPromise;
+ for (const interceptor of this.interceptors) {
+ interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
+ }
+
+ return interceptorPromise.then(() => {
+ if (Object.keys(localVarFormParams).length) {
+ if (localVarUseFormData) {
+ (localVarRequestOptions).formData = localVarFormParams;
+ } else {
+ localVarRequestOptions.form = localVarFormParams;
+ }
+ }
+ return new Promise<{ response: http.IncomingMessage; body: MainRewardValidate; }>((resolve, reject) => {
+ localVarRequest(localVarRequestOptions, (error, response, body) => {
+ if (error) {
+ reject(error);
+ } else {
+ if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
+ body = ObjectSerializer.deserialize(body, "MainRewardValidate");
+ resolve({ response: response, body: body });
+ } else {
+ reject(new HttpError(response, body, response.statusCode));
+ }
+ }
+ });
+ });
+ });
+ }
+}
diff --git a/api/sMSCampaignsApi.ts b/api/sMSCampaignsApi.ts
index 5b62175..9074b91 100644
--- a/api/sMSCampaignsApi.ts
+++ b/api/sMSCampaignsApi.ts
@@ -40,8 +40,7 @@ let defaultBasePath = 'https://api.brevo.com/v3';
// ===============================================
export enum SMSCampaignsApiApiKeys {
- apiKey,
- partnerKey,
+ api-key,
}
export class SMSCampaignsApi {
@@ -51,8 +50,7 @@ export class SMSCampaignsApi {
protected authentications = {
'default':