From 810486b85d5631af4adc9042ac48069045d1c15d Mon Sep 17 00:00:00 2001 From: Aditya Verma Date: Wed, 20 Nov 2024 11:44:08 +0530 Subject: [PATCH] Feat: Added events and track identify api calls --- .openapi-generator/FILES | 27 ++ README.md | 19 +- docs/ContactApi.md | 44 +-- docs/CustomEventRequest.md | 12 + docs/EventApi.md | 110 ++++++++ docs/EventResponse.md | 11 + docs/GettingStartedApi.md | 110 ++++++++ docs/IdentifyRequest.md | 15 ++ docs/IdentifyResponse.md | 11 + docs/RevenueEventRequest.md | 13 + docs/TrackRequest.md | 11 + docs/TrackResponse.md | 10 + package-lock.json | 4 +- package.json | 2 +- src/sendx/api/EventApi.js | 134 +++++++++ src/sendx/api/GettingStartedApi.js | 135 ++++++++++ src/sendx/index.js | 63 +++++ src/sendx/model/CustomEventRequest.js | 193 +++++++++++++ src/sendx/model/EventResponse.js | 159 +++++++++++ src/sendx/model/IdentifyRequest.js | 269 +++++++++++++++++++ src/sendx/model/IdentifyResponse.js | 151 +++++++++++ src/sendx/model/RevenueEventRequest.js | 223 +++++++++++++++ src/sendx/model/TrackRequest.js | 153 +++++++++++ src/sendx/model/TrackResponse.js | 125 +++++++++ test/sendx/api/EventApi.spec.js | 73 +++++ test/sendx/api/GettingStartedApi.spec.js | 73 +++++ test/sendx/model/CustomEventRequest.spec.js | 83 ++++++ test/sendx/model/EventResponse.spec.js | 77 ++++++ test/sendx/model/IdentifyRequest.spec.js | 101 +++++++ test/sendx/model/IdentifyResponse.spec.js | 77 ++++++ test/sendx/model/RevenueEventRequest.spec.js | 89 ++++++ test/sendx/model/TrackRequest.spec.js | 77 ++++++ test/sendx/model/TrackResponse.spec.js | 71 +++++ 33 files changed, 2696 insertions(+), 29 deletions(-) create mode 100644 docs/CustomEventRequest.md create mode 100644 docs/EventApi.md create mode 100644 docs/EventResponse.md create mode 100644 docs/GettingStartedApi.md create mode 100644 docs/IdentifyRequest.md create mode 100644 docs/IdentifyResponse.md create mode 100644 docs/RevenueEventRequest.md create mode 100644 docs/TrackRequest.md create mode 100644 docs/TrackResponse.md create mode 100644 src/sendx/api/EventApi.js create mode 100644 src/sendx/api/GettingStartedApi.js create mode 100644 src/sendx/model/CustomEventRequest.js create mode 100644 src/sendx/model/EventResponse.js create mode 100644 src/sendx/model/IdentifyRequest.js create mode 100644 src/sendx/model/IdentifyResponse.js create mode 100644 src/sendx/model/RevenueEventRequest.js create mode 100644 src/sendx/model/TrackRequest.js create mode 100644 src/sendx/model/TrackResponse.js create mode 100644 test/sendx/api/EventApi.spec.js create mode 100644 test/sendx/api/GettingStartedApi.spec.js create mode 100644 test/sendx/model/CustomEventRequest.spec.js create mode 100644 test/sendx/model/EventResponse.spec.js create mode 100644 test/sendx/model/IdentifyRequest.spec.js create mode 100644 test/sendx/model/IdentifyResponse.spec.js create mode 100644 test/sendx/model/RevenueEventRequest.spec.js create mode 100644 test/sendx/model/TrackRequest.spec.js create mode 100644 test/sendx/model/TrackResponse.spec.js diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 54251b5..b682e85 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -10,10 +10,16 @@ docs/Contact.md docs/ContactApi.md docs/ContactRequest.md docs/CreateResponse.md +docs/CustomEventRequest.md docs/DashboardStats.md docs/DeleteCampaign200Response.md docs/DeleteRequest.md docs/DeleteResponse.md +docs/EventApi.md +docs/EventResponse.md +docs/GettingStartedApi.md +docs/IdentifyRequest.md +docs/IdentifyResponse.md docs/LastSentCampaignStat.md docs/ListApi.md docs/ListModel.md @@ -21,6 +27,7 @@ docs/ListRequest.md docs/ReportData.md docs/ReportsApi.md docs/Response.md +docs/RevenueEventRequest.md docs/Sender.md docs/SenderApi.md docs/SenderRequest.md @@ -28,12 +35,16 @@ docs/SenderResponse.md docs/Tag.md docs/TagRequest.md docs/TagsApi.md +docs/TrackRequest.md +docs/TrackResponse.md git_push.sh mocha.opts package.json src/sendx/ApiClient.js src/sendx/api/CampaignApi.js src/sendx/api/ContactApi.js +src/sendx/api/EventApi.js +src/sendx/api/GettingStartedApi.js src/sendx/api/ListApi.js src/sendx/api/ReportsApi.js src/sendx/api/SenderApi.js @@ -45,17 +56,33 @@ src/sendx/model/CampaignRequest.js src/sendx/model/Contact.js src/sendx/model/ContactRequest.js src/sendx/model/CreateResponse.js +src/sendx/model/CustomEventRequest.js src/sendx/model/DashboardStats.js src/sendx/model/DeleteCampaign200Response.js src/sendx/model/DeleteRequest.js src/sendx/model/DeleteResponse.js +src/sendx/model/EventResponse.js +src/sendx/model/IdentifyRequest.js +src/sendx/model/IdentifyResponse.js src/sendx/model/LastSentCampaignStat.js src/sendx/model/ListModel.js src/sendx/model/ListRequest.js src/sendx/model/ReportData.js src/sendx/model/Response.js +src/sendx/model/RevenueEventRequest.js src/sendx/model/Sender.js src/sendx/model/SenderRequest.js src/sendx/model/SenderResponse.js src/sendx/model/Tag.js src/sendx/model/TagRequest.js +src/sendx/model/TrackRequest.js +src/sendx/model/TrackResponse.js +test/sendx/api/EventApi.spec.js +test/sendx/api/GettingStartedApi.spec.js +test/sendx/model/CustomEventRequest.spec.js +test/sendx/model/EventResponse.spec.js +test/sendx/model/IdentifyRequest.spec.js +test/sendx/model/IdentifyResponse.spec.js +test/sendx/model/RevenueEventRequest.spec.js +test/sendx/model/TrackRequest.spec.js +test/sendx/model/TrackResponse.spec.js diff --git a/README.md b/README.md index 5ae0373..8f5a61b 100644 --- a/README.md +++ b/README.md @@ -92,11 +92,15 @@ Class | Method | HTTP request | Description *sendx.CampaignApi* | [**getAllCampaigns**](docs/CampaignApi.md#getAllCampaigns) | **GET** /campaign | Get All Campaigns *sendx.CampaignApi* | [**getCampaignById**](docs/CampaignApi.md#getCampaignById) | **GET** /campaign/{campaignId} | Get Campaign By Id *sendx.ContactApi* | [**createContact**](docs/ContactApi.md#createContact) | **POST** /contact | Create a contact -*sendx.ContactApi* | [**deleteContact**](docs/ContactApi.md#deleteContact) | **DELETE** /contact/{contactId} | Delete Contact +*sendx.ContactApi* | [**deleteContact**](docs/ContactApi.md#deleteContact) | **DELETE** /contact/{identifier} | Delete Contact *sendx.ContactApi* | [**getAllContacts**](docs/ContactApi.md#getAllContacts) | **GET** /contact | Get All Contacts -*sendx.ContactApi* | [**getContactById**](docs/ContactApi.md#getContactById) | **GET** /contact/{contactId} | Get Contact by ID -*sendx.ContactApi* | [**unsubscribeContact**](docs/ContactApi.md#unsubscribeContact) | **POST** /contact/unsubscribe/{contactId} | Unsubscribe Contact -*sendx.ContactApi* | [**updateContact**](docs/ContactApi.md#updateContact) | **PUT** /contact/{contactId} | Update Contact +*sendx.ContactApi* | [**getContactById**](docs/ContactApi.md#getContactById) | **GET** /contact/{identifier} | Get Contact by Identifier +*sendx.ContactApi* | [**unsubscribeContact**](docs/ContactApi.md#unsubscribeContact) | **POST** /contact/unsubscribe/{identifier} | Unsubscribe Contact +*sendx.ContactApi* | [**updateContact**](docs/ContactApi.md#updateContact) | **PUT** /contact/{identifier} | Update Contact +*sendx.EventApi* | [**createRevenueEvent**](docs/EventApi.md#createRevenueEvent) | **POST** /events/revenue | Record a revenue event for a specific contact +*sendx.EventApi* | [**pushCustomEvent**](docs/EventApi.md#pushCustomEvent) | **POST** /events/custom | Push a custom event associated with a contact +*sendx.GettingStartedApi* | [**identifyContact**](docs/GettingStartedApi.md#identifyContact) | **POST** /contact/identify | Identify contact +*sendx.GettingStartedApi* | [**trackingContact**](docs/GettingStartedApi.md#trackingContact) | **POST** /contact/track | Add Tracking info *sendx.ListApi* | [**createList**](docs/ListApi.md#createList) | **POST** /list | Create List *sendx.ListApi* | [**deleteList**](docs/ListApi.md#deleteList) | **DELETE** /list/{listId} | Delete List *sendx.ListApi* | [**getAllLists**](docs/ListApi.md#getAllLists) | **GET** /list | Get All Lists @@ -120,20 +124,27 @@ Class | Method | HTTP request | Description - [sendx.Contact](docs/Contact.md) - [sendx.ContactRequest](docs/ContactRequest.md) - [sendx.CreateResponse](docs/CreateResponse.md) + - [sendx.CustomEventRequest](docs/CustomEventRequest.md) - [sendx.DashboardStats](docs/DashboardStats.md) - [sendx.DeleteCampaign200Response](docs/DeleteCampaign200Response.md) - [sendx.DeleteRequest](docs/DeleteRequest.md) - [sendx.DeleteResponse](docs/DeleteResponse.md) + - [sendx.EventResponse](docs/EventResponse.md) + - [sendx.IdentifyRequest](docs/IdentifyRequest.md) + - [sendx.IdentifyResponse](docs/IdentifyResponse.md) - [sendx.LastSentCampaignStat](docs/LastSentCampaignStat.md) - [sendx.ListModel](docs/ListModel.md) - [sendx.ListRequest](docs/ListRequest.md) - [sendx.ReportData](docs/ReportData.md) - [sendx.Response](docs/Response.md) + - [sendx.RevenueEventRequest](docs/RevenueEventRequest.md) - [sendx.Sender](docs/Sender.md) - [sendx.SenderRequest](docs/SenderRequest.md) - [sendx.SenderResponse](docs/SenderResponse.md) - [sendx.Tag](docs/Tag.md) - [sendx.TagRequest](docs/TagRequest.md) + - [sendx.TrackRequest](docs/TrackRequest.md) + - [sendx.TrackResponse](docs/TrackResponse.md) ## Documentation for Authorization diff --git a/docs/ContactApi.md b/docs/ContactApi.md index 0a0ccbb..87964ef 100644 --- a/docs/ContactApi.md +++ b/docs/ContactApi.md @@ -5,11 +5,11 @@ All URIs are relative to *https://api.sendx.io/api/v1/rest* Method | HTTP request | Description ------------- | ------------- | ------------- [**createContact**](ContactApi.md#createContact) | **POST** /contact | Create a contact -[**deleteContact**](ContactApi.md#deleteContact) | **DELETE** /contact/{contactId} | Delete Contact +[**deleteContact**](ContactApi.md#deleteContact) | **DELETE** /contact/{identifier} | Delete Contact [**getAllContacts**](ContactApi.md#getAllContacts) | **GET** /contact | Get All Contacts -[**getContactById**](ContactApi.md#getContactById) | **GET** /contact/{contactId} | Get Contact by ID -[**unsubscribeContact**](ContactApi.md#unsubscribeContact) | **POST** /contact/unsubscribe/{contactId} | Unsubscribe Contact -[**updateContact**](ContactApi.md#updateContact) | **PUT** /contact/{contactId} | Update Contact +[**getContactById**](ContactApi.md#getContactById) | **GET** /contact/{identifier} | Get Contact by Identifier +[**unsubscribeContact**](ContactApi.md#unsubscribeContact) | **POST** /contact/unsubscribe/{identifier} | Unsubscribe Contact +[**updateContact**](ContactApi.md#updateContact) | **PUT** /contact/{identifier} | Update Contact @@ -65,7 +65,7 @@ Name | Type | Description | Notes ## deleteContact -> Response deleteContact(contactId) +> Response deleteContact(identifier) Delete Contact @@ -83,8 +83,8 @@ apiKeyAuth.apiKey = 'YOUR API KEY'; //apiKeyAuth.apiKeyPrefix = 'Token'; let apiInstance = new sendx.ContactApi(); -let contactId = "contactId_example"; // String | The Contact ID to delete -apiInstance.deleteContact(contactId).then((data) => { +let identifier = "identifier_example"; // String | The Contact ID/ Email to delete +apiInstance.deleteContact(identifier).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); @@ -97,7 +97,7 @@ apiInstance.deleteContact(contactId).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **contactId** | **String**| The Contact ID to delete | + **identifier** | **String**| The Contact ID/ Email to delete | ### Return type @@ -173,11 +173,11 @@ Name | Type | Description | Notes ## getContactById -> Contact getContactById(contactId) +> Contact getContactById(identifier) -Get Contact by ID +Get Contact by Identifier -Retrieve a specific contact by its contactId. +Retrieve a specific contact by its identifier. ### Example @@ -191,8 +191,8 @@ apiKeyAuth.apiKey = 'YOUR API KEY'; //apiKeyAuth.apiKeyPrefix = 'Token'; let apiInstance = new sendx.ContactApi(); -let contactId = "sendxid123"; // String | The ID of the contact to retrieve. -apiInstance.getContactById(contactId).then((data) => { +let identifier = "john@doe.com"; // String | The ID or Email of the contact to retrieve. +apiInstance.getContactById(identifier).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); @@ -205,7 +205,7 @@ apiInstance.getContactById(contactId).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **contactId** | **String**| The ID of the contact to retrieve. | + **identifier** | **String**| The ID or Email of the contact to retrieve. | ### Return type @@ -223,7 +223,7 @@ Name | Type | Description | Notes ## unsubscribeContact -> Response unsubscribeContact(contactId) +> Response unsubscribeContact(identifier) Unsubscribe Contact @@ -241,8 +241,8 @@ apiKeyAuth.apiKey = 'YOUR API KEY'; //apiKeyAuth.apiKeyPrefix = 'Token'; let apiInstance = new sendx.ContactApi(); -let contactId = "sendx123"; // String | The Contact ID to unsubscribe -apiInstance.unsubscribeContact(contactId).then((data) => { +let identifier = "sendx123"; // String | The Contact ID or email to unsubscribe +apiInstance.unsubscribeContact(identifier).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); @@ -255,7 +255,7 @@ apiInstance.unsubscribeContact(contactId).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **contactId** | **String**| The Contact ID to unsubscribe | + **identifier** | **String**| The Contact ID or email to unsubscribe | ### Return type @@ -273,7 +273,7 @@ Name | Type | Description | Notes ## updateContact -> Contact updateContact(contactRequest, contactId) +> Contact updateContact(contactRequest, identifier) Update Contact @@ -292,8 +292,8 @@ apiKeyAuth.apiKey = 'YOUR API KEY'; let apiInstance = new sendx.ContactApi(); let contactRequest = new sendx.ContactRequest(); // ContactRequest | -let contactId = "sendxid123"; // String | The ID of the Contact to update -apiInstance.updateContact(contactRequest, contactId).then((data) => { +let identifier = "sendxid123"; // String | The ID or email of the Contact to update +apiInstance.updateContact(contactRequest, identifier).then((data) => { console.log('API called successfully. Returned data: ' + data); }, (error) => { console.error(error); @@ -307,7 +307,7 @@ apiInstance.updateContact(contactRequest, contactId).then((data) => { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contactRequest** | [**ContactRequest**](ContactRequest.md)| | - **contactId** | **String**| The ID of the Contact to update | + **identifier** | **String**| The ID or email of the Contact to update | ### Return type diff --git a/docs/CustomEventRequest.md b/docs/CustomEventRequest.md new file mode 100644 index 0000000..c97fbe7 --- /dev/null +++ b/docs/CustomEventRequest.md @@ -0,0 +1,12 @@ +# sendx.CustomEventRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the custom event (e.g., 'abandoned_cart'). | +**identifier** | **String** | Unique identifier for the contact (e.g., contact's email). | +**data** | **{String: String}** | Map of property-value pairs associated with the event, where both key and value are strings. | +**time** | **Number** | Unix timestamp of when the event occurred. | + + diff --git a/docs/EventApi.md b/docs/EventApi.md new file mode 100644 index 0000000..3e835d9 --- /dev/null +++ b/docs/EventApi.md @@ -0,0 +1,110 @@ +# sendx.EventApi + +All URIs are relative to *https://api.sendx.io/api/v1/rest* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createRevenueEvent**](EventApi.md#createRevenueEvent) | **POST** /events/revenue | Record a revenue event for a specific contact +[**pushCustomEvent**](EventApi.md#pushCustomEvent) | **POST** /events/custom | Push a custom event associated with a contact + + + +## createRevenueEvent + +> EventResponse createRevenueEvent(revenueEventRequest) + +Record a revenue event for a specific contact + +Records a revenue event, which can be attributed to campaigns, drips, workflows, or other sources of user interaction. + +### Example + +```javascript +import sendx from 'sendx-javascript-sdk'; +let defaultClient = sendx.ApiClient.instance; +// Configure API key authorization: apiKeyAuth +let apiKeyAuth = defaultClient.authentications['apiKeyAuth']; +apiKeyAuth.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//apiKeyAuth.apiKeyPrefix = 'Token'; + +let apiInstance = new sendx.EventApi(); +let revenueEventRequest = new sendx.RevenueEventRequest(); // RevenueEventRequest | +apiInstance.createRevenueEvent(revenueEventRequest).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **revenueEventRequest** | [**RevenueEventRequest**](RevenueEventRequest.md)| | + +### Return type + +[**EventResponse**](EventResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## pushCustomEvent + +> EventResponse pushCustomEvent(customEventRequest) + +Push a custom event associated with a contact + +Pushes a custom event with properties and values for a specified contact. + +### Example + +```javascript +import sendx from 'sendx-javascript-sdk'; +let defaultClient = sendx.ApiClient.instance; +// Configure API key authorization: apiKeyAuth +let apiKeyAuth = defaultClient.authentications['apiKeyAuth']; +apiKeyAuth.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//apiKeyAuth.apiKeyPrefix = 'Token'; + +let apiInstance = new sendx.EventApi(); +let customEventRequest = new sendx.CustomEventRequest(); // CustomEventRequest | +apiInstance.pushCustomEvent(customEventRequest).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customEventRequest** | [**CustomEventRequest**](CustomEventRequest.md)| | + +### Return type + +[**EventResponse**](EventResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/EventResponse.md b/docs/EventResponse.md new file mode 100644 index 0000000..f9a448f --- /dev/null +++ b/docs/EventResponse.md @@ -0,0 +1,11 @@ +# sendx.EventResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**eventId** | **String** | Unique identifier for the created event. | [optional] +**status** | **String** | Status of the event creation (e.g., 'success'). | [optional] +**message** | **String** | Additional message about the event creation. | [optional] + + diff --git a/docs/GettingStartedApi.md b/docs/GettingStartedApi.md new file mode 100644 index 0000000..9ff3f85 --- /dev/null +++ b/docs/GettingStartedApi.md @@ -0,0 +1,110 @@ +# sendx.GettingStartedApi + +All URIs are relative to *https://api.sendx.io/api/v1/rest* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**identifyContact**](GettingStartedApi.md#identifyContact) | **POST** /contact/identify | Identify contact +[**trackingContact**](GettingStartedApi.md#trackingContact) | **POST** /contact/track | Add Tracking info + + + +## identifyContact + +> IdentifyResponse identifyContact(identifyRequest) + +Identify contact + +Identify a contact by email address. If the contact already exists, it will be updated. + +### Example + +```javascript +import sendx from 'sendx-javascript-sdk'; +let defaultClient = sendx.ApiClient.instance; +// Configure API key authorization: apiKeyAuth +let apiKeyAuth = defaultClient.authentications['apiKeyAuth']; +apiKeyAuth.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//apiKeyAuth.apiKeyPrefix = 'Token'; + +let apiInstance = new sendx.GettingStartedApi(); +let identifyRequest = new sendx.IdentifyRequest(); // IdentifyRequest | +apiInstance.identifyContact(identifyRequest).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **identifyRequest** | [**IdentifyRequest**](IdentifyRequest.md)| | + +### Return type + +[**IdentifyResponse**](IdentifyResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## trackingContact + +> TrackResponse trackingContact(trackRequest) + +Add Tracking info + +Track a contact + +### Example + +```javascript +import sendx from 'sendx-javascript-sdk'; +let defaultClient = sendx.ApiClient.instance; +// Configure API key authorization: apiKeyAuth +let apiKeyAuth = defaultClient.authentications['apiKeyAuth']; +apiKeyAuth.apiKey = 'YOUR API KEY'; +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//apiKeyAuth.apiKeyPrefix = 'Token'; + +let apiInstance = new sendx.GettingStartedApi(); +let trackRequest = new sendx.TrackRequest(); // TrackRequest | +apiInstance.trackingContact(trackRequest).then((data) => { + console.log('API called successfully. Returned data: ' + data); +}, (error) => { + console.error(error); +}); + +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **trackRequest** | [**TrackRequest**](TrackRequest.md)| | + +### Return type + +[**TrackResponse**](TrackResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/IdentifyRequest.md b/docs/IdentifyRequest.md new file mode 100644 index 0000000..3355d9d --- /dev/null +++ b/docs/IdentifyRequest.md @@ -0,0 +1,15 @@ +# sendx.IdentifyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**firstName** | **String** | First name of the contact. | [optional] +**lastName** | **String** | Last name of the contact. | [optional] +**email** | **String** | Email address of the contact. | +**newEmail** | **String** | New email address of the contact. | [optional] +**company** | **String** | Company of the contact. | [optional] +**tags** | **[String]** | | [optional] +**customFields** | **{String: String}** | | [optional] + + diff --git a/docs/IdentifyResponse.md b/docs/IdentifyResponse.md new file mode 100644 index 0000000..faa4458 --- /dev/null +++ b/docs/IdentifyResponse.md @@ -0,0 +1,11 @@ +# sendx.IdentifyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | | [optional] +**message** | **String** | | [optional] +**data** | [**Contact**](Contact.md) | | [optional] + + diff --git a/docs/RevenueEventRequest.md b/docs/RevenueEventRequest.md new file mode 100644 index 0000000..5ef2583 --- /dev/null +++ b/docs/RevenueEventRequest.md @@ -0,0 +1,13 @@ +# sendx.RevenueEventRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**identifier** | **String** | Unique identifier for the contact. | +**amount** | **Number** | Recognized revenue amount associated with the event. | +**currency** | **String** | Currency code (ISO 4217) for the revenue (e.g., 'USD', 'EUR', 'INR'). | +**source** | **String** | Source of the revenue (e.g., 'website', 'mobile app', 'partner referral'). | +**time** | **Number** | Unix timestamp indicating when the revenue event occurred. | + + diff --git a/docs/TrackRequest.md b/docs/TrackRequest.md new file mode 100644 index 0000000..eda6792 --- /dev/null +++ b/docs/TrackRequest.md @@ -0,0 +1,11 @@ +# sendx.TrackRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | Email address of the contact to track. | [optional] +**addTags** | **[String]** | | [optional] +**removeTags** | **[String]** | | [optional] + + diff --git a/docs/TrackResponse.md b/docs/TrackResponse.md new file mode 100644 index 0000000..b4e84bb --- /dev/null +++ b/docs/TrackResponse.md @@ -0,0 +1,10 @@ +# sendx.TrackResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | | [optional] +**message** | **String** | | [optional] + + diff --git a/package-lock.json b/package-lock.json index 2c8cd5a..5d5f151 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sendx-javascript-sdk", - "version": "1.0.5", + "version": "1.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sendx-javascript-sdk", - "version": "1.0.5", + "version": "1.1.0", "license": "Unlicense", "dependencies": { "@babel/cli": "^7.0.0", diff --git a/package.json b/package.json index 8b1ee47..a7cb12f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sendx-javascript-sdk", - "version": "1.0.5", + "version": "1.1.0", "description": "SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
", "license": "MIT", "main": "dist/sendx/index.js", diff --git a/src/sendx/api/EventApi.js b/src/sendx/api/EventApi.js new file mode 100644 index 0000000..44cad6e --- /dev/null +++ b/src/sendx/api/EventApi.js @@ -0,0 +1,134 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + + +import ApiClient from "../ApiClient"; +import CustomEventRequest from '../model/CustomEventRequest'; +import EventResponse from '../model/EventResponse'; +import RevenueEventRequest from '../model/RevenueEventRequest'; + +/** +* Event service. +* @module sendx/api/EventApi +* @version 1.0.0 +*/ +export default class EventApi { + + /** + * Constructs a new EventApi. + * @alias module:sendx/api/EventApi + * @class + * @param {module:sendx/ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:sendx/ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + + /** + * Record a revenue event for a specific contact + * Records a revenue event, which can be attributed to campaigns, drips, workflows, or other sources of user interaction. + * @param {module:sendx/model/RevenueEventRequest} revenueEventRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:sendx/model/EventResponse} and HTTP response + */ + createRevenueEventWithHttpInfo(revenueEventRequest) { + let postBody = revenueEventRequest; + // verify the required parameter 'revenueEventRequest' is set + if (revenueEventRequest === undefined || revenueEventRequest === null) { + throw new Error("Missing the required parameter 'revenueEventRequest' when calling createRevenueEvent"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['apiKeyAuth']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = EventResponse; + return this.apiClient.callApi( + '/events/revenue', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Record a revenue event for a specific contact + * Records a revenue event, which can be attributed to campaigns, drips, workflows, or other sources of user interaction. + * @param {module:sendx/model/RevenueEventRequest} revenueEventRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:sendx/model/EventResponse} + */ + createRevenueEvent(revenueEventRequest) { + return this.createRevenueEventWithHttpInfo(revenueEventRequest) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Push a custom event associated with a contact + * Pushes a custom event with properties and values for a specified contact. + * @param {module:sendx/model/CustomEventRequest} customEventRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:sendx/model/EventResponse} and HTTP response + */ + pushCustomEventWithHttpInfo(customEventRequest) { + let postBody = customEventRequest; + // verify the required parameter 'customEventRequest' is set + if (customEventRequest === undefined || customEventRequest === null) { + throw new Error("Missing the required parameter 'customEventRequest' when calling pushCustomEvent"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['apiKeyAuth']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = EventResponse; + return this.apiClient.callApi( + '/events/custom', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Push a custom event associated with a contact + * Pushes a custom event with properties and values for a specified contact. + * @param {module:sendx/model/CustomEventRequest} customEventRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:sendx/model/EventResponse} + */ + pushCustomEvent(customEventRequest) { + return this.pushCustomEventWithHttpInfo(customEventRequest) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + +} diff --git a/src/sendx/api/GettingStartedApi.js b/src/sendx/api/GettingStartedApi.js new file mode 100644 index 0000000..9bd6f46 --- /dev/null +++ b/src/sendx/api/GettingStartedApi.js @@ -0,0 +1,135 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + + +import ApiClient from "../ApiClient"; +import IdentifyRequest from '../model/IdentifyRequest'; +import IdentifyResponse from '../model/IdentifyResponse'; +import TrackRequest from '../model/TrackRequest'; +import TrackResponse from '../model/TrackResponse'; + +/** +* GettingStarted service. +* @module sendx/api/GettingStartedApi +* @version 1.0.0 +*/ +export default class GettingStartedApi { + + /** + * Constructs a new GettingStartedApi. + * @alias module:sendx/api/GettingStartedApi + * @class + * @param {module:sendx/ApiClient} [apiClient] Optional API client implementation to use, + * default to {@link module:sendx/ApiClient#instance} if unspecified. + */ + constructor(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + } + + + + /** + * Identify contact + * Identify a contact by email address. If the contact already exists, it will be updated. + * @param {module:sendx/model/IdentifyRequest} identifyRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:sendx/model/IdentifyResponse} and HTTP response + */ + identifyContactWithHttpInfo(identifyRequest) { + let postBody = identifyRequest; + // verify the required parameter 'identifyRequest' is set + if (identifyRequest === undefined || identifyRequest === null) { + throw new Error("Missing the required parameter 'identifyRequest' when calling identifyContact"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['apiKeyAuth']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = IdentifyResponse; + return this.apiClient.callApi( + '/contact/identify', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Identify contact + * Identify a contact by email address. If the contact already exists, it will be updated. + * @param {module:sendx/model/IdentifyRequest} identifyRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:sendx/model/IdentifyResponse} + */ + identifyContact(identifyRequest) { + return this.identifyContactWithHttpInfo(identifyRequest) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * Add Tracking info + * Track a contact + * @param {module:sendx/model/TrackRequest} trackRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:sendx/model/TrackResponse} and HTTP response + */ + trackingContactWithHttpInfo(trackRequest) { + let postBody = trackRequest; + // verify the required parameter 'trackRequest' is set + if (trackRequest === undefined || trackRequest === null) { + throw new Error("Missing the required parameter 'trackRequest' when calling trackingContact"); + } + + let pathParams = { + }; + let queryParams = { + }; + let headerParams = { + }; + let formParams = { + }; + + let authNames = ['apiKeyAuth']; + let contentTypes = ['application/json']; + let accepts = ['application/json']; + let returnType = TrackResponse; + return this.apiClient.callApi( + '/contact/track', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType, null + ); + } + + /** + * Add Tracking info + * Track a contact + * @param {module:sendx/model/TrackRequest} trackRequest + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:sendx/model/TrackResponse} + */ + trackingContact(trackRequest) { + return this.trackingContactWithHttpInfo(trackRequest) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + +} diff --git a/src/sendx/index.js b/src/sendx/index.js index 61fe794..fa81377 100644 --- a/src/sendx/index.js +++ b/src/sendx/index.js @@ -19,22 +19,31 @@ import CampaignRequest from './model/CampaignRequest'; import Contact from './model/Contact'; import ContactRequest from './model/ContactRequest'; import CreateResponse from './model/CreateResponse'; +import CustomEventRequest from './model/CustomEventRequest'; import DashboardStats from './model/DashboardStats'; import DeleteCampaign200Response from './model/DeleteCampaign200Response'; import DeleteRequest from './model/DeleteRequest'; import DeleteResponse from './model/DeleteResponse'; +import EventResponse from './model/EventResponse'; +import IdentifyRequest from './model/IdentifyRequest'; +import IdentifyResponse from './model/IdentifyResponse'; import LastSentCampaignStat from './model/LastSentCampaignStat'; import ListModel from './model/ListModel'; import ListRequest from './model/ListRequest'; import ReportData from './model/ReportData'; import Response from './model/Response'; +import RevenueEventRequest from './model/RevenueEventRequest'; import Sender from './model/Sender'; import SenderRequest from './model/SenderRequest'; import SenderResponse from './model/SenderResponse'; import Tag from './model/Tag'; import TagRequest from './model/TagRequest'; +import TrackRequest from './model/TrackRequest'; +import TrackResponse from './model/TrackResponse'; import CampaignApi from './api/CampaignApi'; import ContactApi from './api/ContactApi'; +import EventApi from './api/EventApi'; +import GettingStartedApi from './api/GettingStartedApi'; import ListApi from './api/ListApi'; import ReportsApi from './api/ReportsApi'; import SenderApi from './api/SenderApi'; @@ -115,6 +124,12 @@ export { */ CreateResponse, + /** + * The CustomEventRequest model constructor. + * @property {module:sendx/model/CustomEventRequest} + */ + CustomEventRequest, + /** * The DashboardStats model constructor. * @property {module:sendx/model/DashboardStats} @@ -139,6 +154,24 @@ export { */ DeleteResponse, + /** + * The EventResponse model constructor. + * @property {module:sendx/model/EventResponse} + */ + EventResponse, + + /** + * The IdentifyRequest model constructor. + * @property {module:sendx/model/IdentifyRequest} + */ + IdentifyRequest, + + /** + * The IdentifyResponse model constructor. + * @property {module:sendx/model/IdentifyResponse} + */ + IdentifyResponse, + /** * The LastSentCampaignStat model constructor. * @property {module:sendx/model/LastSentCampaignStat} @@ -169,6 +202,12 @@ export { */ Response, + /** + * The RevenueEventRequest model constructor. + * @property {module:sendx/model/RevenueEventRequest} + */ + RevenueEventRequest, + /** * The Sender model constructor. * @property {module:sendx/model/Sender} @@ -199,6 +238,18 @@ export { */ TagRequest, + /** + * The TrackRequest model constructor. + * @property {module:sendx/model/TrackRequest} + */ + TrackRequest, + + /** + * The TrackResponse model constructor. + * @property {module:sendx/model/TrackResponse} + */ + TrackResponse, + /** * The CampaignApi service constructor. * @property {module:sendx/api/CampaignApi} @@ -211,6 +262,18 @@ export { */ ContactApi, + /** + * The EventApi service constructor. + * @property {module:sendx/api/EventApi} + */ + EventApi, + + /** + * The GettingStartedApi service constructor. + * @property {module:sendx/api/GettingStartedApi} + */ + GettingStartedApi, + /** * The ListApi service constructor. * @property {module:sendx/api/ListApi} diff --git a/src/sendx/model/CustomEventRequest.js b/src/sendx/model/CustomEventRequest.js new file mode 100644 index 0000000..faacdc0 --- /dev/null +++ b/src/sendx/model/CustomEventRequest.js @@ -0,0 +1,193 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The CustomEventRequest model module. + * @module sendx/model/CustomEventRequest + * @version 1.0.0 + */ +class CustomEventRequest { + /** + * Constructs a new CustomEventRequest. + * @alias module:sendx/model/CustomEventRequest + * @param name {String} Name of the custom event (e.g., 'abandoned_cart'). + * @param identifier {String} Unique identifier for the contact (e.g., contact's email). + * @param data {Object.} Map of property-value pairs associated with the event, where both key and value are strings. + * @param time {Number} Unix timestamp of when the event occurred. + */ + constructor(name, identifier, data, time) { + + CustomEventRequest.initialize(this, name, identifier, data, time); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, name, identifier, data, time) { + obj['name'] = name; + obj['identifier'] = identifier; + obj['data'] = data; + obj['time'] = time; + } + + /** + * Constructs a CustomEventRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:sendx/model/CustomEventRequest} obj Optional instance to populate. + * @return {module:sendx/model/CustomEventRequest} The populated CustomEventRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new CustomEventRequest(); + + if (data.hasOwnProperty('name')) { + obj['name'] = ApiClient.convertToType(data['name'], 'String'); + } + if (data.hasOwnProperty('identifier')) { + obj['identifier'] = ApiClient.convertToType(data['identifier'], 'String'); + } + if (data.hasOwnProperty('data')) { + obj['data'] = ApiClient.convertToType(data['data'], {'String': 'String'}); + } + if (data.hasOwnProperty('time')) { + obj['time'] = ApiClient.convertToType(data['time'], 'Number'); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to CustomEventRequest. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to CustomEventRequest. + */ + static validateJSON(data) { + // check to make sure all required properties are present in the JSON string + for (const property of CustomEventRequest.RequiredProperties) { + if (!data.hasOwnProperty(property)) { + throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); + } + } + // ensure the json data is a string + if (data['name'] && !(typeof data['name'] === 'string' || data['name'] instanceof String)) { + throw new Error("Expected the field `name` to be a primitive type in the JSON string but got " + data['name']); + } + // ensure the json data is a string + if (data['identifier'] && !(typeof data['identifier'] === 'string' || data['identifier'] instanceof String)) { + throw new Error("Expected the field `identifier` to be a primitive type in the JSON string but got " + data['identifier']); + } + + return true; + } + +/** + * Returns Name of the custom event (e.g., 'abandoned_cart'). + * @return {String} + */ + getName() { + return this.name; + } + + /** + * Sets Name of the custom event (e.g., 'abandoned_cart'). + * @param {String} name Name of the custom event (e.g., 'abandoned_cart'). + */ + setName(name) { + this['name'] = name; + } +/** + * Returns Unique identifier for the contact (e.g., contact's email). + * @return {String} + */ + getIdentifier() { + return this.identifier; + } + + /** + * Sets Unique identifier for the contact (e.g., contact's email). + * @param {String} identifier Unique identifier for the contact (e.g., contact's email). + */ + setIdentifier(identifier) { + this['identifier'] = identifier; + } +/** + * Returns Map of property-value pairs associated with the event, where both key and value are strings. + * @return {Object.} + */ + getData() { + return this.data; + } + + /** + * Sets Map of property-value pairs associated with the event, where both key and value are strings. + * @param {Object.} data Map of property-value pairs associated with the event, where both key and value are strings. + */ + setData(data) { + this['data'] = data; + } +/** + * Returns Unix timestamp of when the event occurred. + * @return {Number} + */ + getTime() { + return this.time; + } + + /** + * Sets Unix timestamp of when the event occurred. + * @param {Number} time Unix timestamp of when the event occurred. + */ + setTime(time) { + this['time'] = time; + } + +} + +CustomEventRequest.RequiredProperties = ["name", "identifier", "data", "time"]; + +/** + * Name of the custom event (e.g., 'abandoned_cart'). + * @member {String} name + */ +CustomEventRequest.prototype['name'] = undefined; + +/** + * Unique identifier for the contact (e.g., contact's email). + * @member {String} identifier + */ +CustomEventRequest.prototype['identifier'] = undefined; + +/** + * Map of property-value pairs associated with the event, where both key and value are strings. + * @member {Object.} data + */ +CustomEventRequest.prototype['data'] = undefined; + +/** + * Unix timestamp of when the event occurred. + * @member {Number} time + */ +CustomEventRequest.prototype['time'] = undefined; + + + + + + +export default CustomEventRequest; + diff --git a/src/sendx/model/EventResponse.js b/src/sendx/model/EventResponse.js new file mode 100644 index 0000000..49b6717 --- /dev/null +++ b/src/sendx/model/EventResponse.js @@ -0,0 +1,159 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The EventResponse model module. + * @module sendx/model/EventResponse + * @version 1.0.0 + */ +class EventResponse { + /** + * Constructs a new EventResponse. + * @alias module:sendx/model/EventResponse + */ + constructor() { + + EventResponse.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a EventResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:sendx/model/EventResponse} obj Optional instance to populate. + * @return {module:sendx/model/EventResponse} The populated EventResponse instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new EventResponse(); + + if (data.hasOwnProperty('event_id')) { + obj['event_id'] = ApiClient.convertToType(data['event_id'], 'String'); + } + if (data.hasOwnProperty('status')) { + obj['status'] = ApiClient.convertToType(data['status'], 'String'); + } + if (data.hasOwnProperty('message')) { + obj['message'] = ApiClient.convertToType(data['message'], 'String'); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to EventResponse. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to EventResponse. + */ + static validateJSON(data) { + // ensure the json data is a string + if (data['event_id'] && !(typeof data['event_id'] === 'string' || data['event_id'] instanceof String)) { + throw new Error("Expected the field `event_id` to be a primitive type in the JSON string but got " + data['event_id']); + } + // ensure the json data is a string + if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) { + throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']); + } + // ensure the json data is a string + if (data['message'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) { + throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']); + } + + return true; + } + +/** + * Returns Unique identifier for the created event. + * @return {String} + */ + getEventId() { + return this.event_id; + } + + /** + * Sets Unique identifier for the created event. + * @param {String} eventId Unique identifier for the created event. + */ + setEventId(eventId) { + this['event_id'] = eventId; + } +/** + * Returns Status of the event creation (e.g., 'success'). + * @return {String} + */ + getStatus() { + return this.status; + } + + /** + * Sets Status of the event creation (e.g., 'success'). + * @param {String} status Status of the event creation (e.g., 'success'). + */ + setStatus(status) { + this['status'] = status; + } +/** + * Returns Additional message about the event creation. + * @return {String} + */ + getMessage() { + return this.message; + } + + /** + * Sets Additional message about the event creation. + * @param {String} message Additional message about the event creation. + */ + setMessage(message) { + this['message'] = message; + } + +} + + + +/** + * Unique identifier for the created event. + * @member {String} event_id + */ +EventResponse.prototype['event_id'] = undefined; + +/** + * Status of the event creation (e.g., 'success'). + * @member {String} status + */ +EventResponse.prototype['status'] = undefined; + +/** + * Additional message about the event creation. + * @member {String} message + */ +EventResponse.prototype['message'] = undefined; + + + + + + +export default EventResponse; + diff --git a/src/sendx/model/IdentifyRequest.js b/src/sendx/model/IdentifyRequest.js new file mode 100644 index 0000000..7c3b106 --- /dev/null +++ b/src/sendx/model/IdentifyRequest.js @@ -0,0 +1,269 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The IdentifyRequest model module. + * @module sendx/model/IdentifyRequest + * @version 1.0.0 + */ +class IdentifyRequest { + /** + * Constructs a new IdentifyRequest. + * @alias module:sendx/model/IdentifyRequest + * @param email {String} Email address of the contact. + */ + constructor(email) { + + IdentifyRequest.initialize(this, email); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, email) { + obj['email'] = email; + } + + /** + * Constructs a IdentifyRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:sendx/model/IdentifyRequest} obj Optional instance to populate. + * @return {module:sendx/model/IdentifyRequest} The populated IdentifyRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IdentifyRequest(); + + if (data.hasOwnProperty('firstName')) { + obj['firstName'] = ApiClient.convertToType(data['firstName'], 'String'); + } + if (data.hasOwnProperty('lastName')) { + obj['lastName'] = ApiClient.convertToType(data['lastName'], 'String'); + } + if (data.hasOwnProperty('email')) { + obj['email'] = ApiClient.convertToType(data['email'], 'String'); + } + if (data.hasOwnProperty('newEmail')) { + obj['newEmail'] = ApiClient.convertToType(data['newEmail'], 'String'); + } + if (data.hasOwnProperty('company')) { + obj['company'] = ApiClient.convertToType(data['company'], 'String'); + } + if (data.hasOwnProperty('tags')) { + obj['tags'] = ApiClient.convertToType(data['tags'], ['String']); + } + if (data.hasOwnProperty('customFields')) { + obj['customFields'] = ApiClient.convertToType(data['customFields'], {'String': 'String'}); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to IdentifyRequest. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to IdentifyRequest. + */ + static validateJSON(data) { + // check to make sure all required properties are present in the JSON string + for (const property of IdentifyRequest.RequiredProperties) { + if (!data.hasOwnProperty(property)) { + throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); + } + } + // ensure the json data is a string + if (data['firstName'] && !(typeof data['firstName'] === 'string' || data['firstName'] instanceof String)) { + throw new Error("Expected the field `firstName` to be a primitive type in the JSON string but got " + data['firstName']); + } + // ensure the json data is a string + if (data['lastName'] && !(typeof data['lastName'] === 'string' || data['lastName'] instanceof String)) { + throw new Error("Expected the field `lastName` to be a primitive type in the JSON string but got " + data['lastName']); + } + // ensure the json data is a string + if (data['email'] && !(typeof data['email'] === 'string' || data['email'] instanceof String)) { + throw new Error("Expected the field `email` to be a primitive type in the JSON string but got " + data['email']); + } + // ensure the json data is a string + if (data['newEmail'] && !(typeof data['newEmail'] === 'string' || data['newEmail'] instanceof String)) { + throw new Error("Expected the field `newEmail` to be a primitive type in the JSON string but got " + data['newEmail']); + } + // ensure the json data is a string + if (data['company'] && !(typeof data['company'] === 'string' || data['company'] instanceof String)) { + throw new Error("Expected the field `company` to be a primitive type in the JSON string but got " + data['company']); + } + // ensure the json data is an array + if (!Array.isArray(data['tags'])) { + throw new Error("Expected the field `tags` to be an array in the JSON data but got " + data['tags']); + } + + return true; + } + +/** + * Returns First name of the contact. + * @return {String} + */ + getFirstName() { + return this.firstName; + } + + /** + * Sets First name of the contact. + * @param {String} firstName First name of the contact. + */ + setFirstName(firstName) { + this['firstName'] = firstName; + } +/** + * Returns Last name of the contact. + * @return {String} + */ + getLastName() { + return this.lastName; + } + + /** + * Sets Last name of the contact. + * @param {String} lastName Last name of the contact. + */ + setLastName(lastName) { + this['lastName'] = lastName; + } +/** + * Returns Email address of the contact. + * @return {String} + */ + getEmail() { + return this.email; + } + + /** + * Sets Email address of the contact. + * @param {String} email Email address of the contact. + */ + setEmail(email) { + this['email'] = email; + } +/** + * Returns New email address of the contact. + * @return {String} + */ + getNewEmail() { + return this.newEmail; + } + + /** + * Sets New email address of the contact. + * @param {String} newEmail New email address of the contact. + */ + setNewEmail(newEmail) { + this['newEmail'] = newEmail; + } +/** + * Returns Company of the contact. + * @return {String} + */ + getCompany() { + return this.company; + } + + /** + * Sets Company of the contact. + * @param {String} company Company of the contact. + */ + setCompany(company) { + this['company'] = company; + } +/** + * @return {Array.} + */ + getTags() { + return this.tags; + } + + /** + * @param {Array.} tags + */ + setTags(tags) { + this['tags'] = tags; + } +/** + * @return {Object.} + */ + getCustomFields() { + return this.customFields; + } + + /** + * @param {Object.} customFields + */ + setCustomFields(customFields) { + this['customFields'] = customFields; + } + +} + +IdentifyRequest.RequiredProperties = ["email"]; + +/** + * First name of the contact. + * @member {String} firstName + */ +IdentifyRequest.prototype['firstName'] = undefined; + +/** + * Last name of the contact. + * @member {String} lastName + */ +IdentifyRequest.prototype['lastName'] = undefined; + +/** + * Email address of the contact. + * @member {String} email + */ +IdentifyRequest.prototype['email'] = undefined; + +/** + * New email address of the contact. + * @member {String} newEmail + */ +IdentifyRequest.prototype['newEmail'] = undefined; + +/** + * Company of the contact. + * @member {String} company + */ +IdentifyRequest.prototype['company'] = undefined; + +/** + * @member {Array.} tags + */ +IdentifyRequest.prototype['tags'] = undefined; + +/** + * @member {Object.} customFields + */ +IdentifyRequest.prototype['customFields'] = undefined; + + + + + + +export default IdentifyRequest; + diff --git a/src/sendx/model/IdentifyResponse.js b/src/sendx/model/IdentifyResponse.js new file mode 100644 index 0000000..2ec1280 --- /dev/null +++ b/src/sendx/model/IdentifyResponse.js @@ -0,0 +1,151 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; +import Contact from './Contact'; + +/** + * The IdentifyResponse model module. + * @module sendx/model/IdentifyResponse + * @version 1.0.0 + */ +class IdentifyResponse { + /** + * Constructs a new IdentifyResponse. + * @alias module:sendx/model/IdentifyResponse + */ + constructor() { + + IdentifyResponse.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a IdentifyResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:sendx/model/IdentifyResponse} obj Optional instance to populate. + * @return {module:sendx/model/IdentifyResponse} The populated IdentifyResponse instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new IdentifyResponse(); + + if (data.hasOwnProperty('status')) { + obj['status'] = ApiClient.convertToType(data['status'], 'String'); + } + if (data.hasOwnProperty('message')) { + obj['message'] = ApiClient.convertToType(data['message'], 'String'); + } + if (data.hasOwnProperty('data')) { + obj['data'] = Contact.constructFromObject(data['data']); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to IdentifyResponse. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to IdentifyResponse. + */ + static validateJSON(data) { + // ensure the json data is a string + if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) { + throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']); + } + // ensure the json data is a string + if (data['message'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) { + throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']); + } + // validate the optional field `data` + if (data['data']) { // data not null + Contact.validateJSON(data['data']); + } + + return true; + } + +/** + * @return {String} + */ + getStatus() { + return this.status; + } + + /** + * @param {String} status + */ + setStatus(status) { + this['status'] = status; + } +/** + * @return {String} + */ + getMessage() { + return this.message; + } + + /** + * @param {String} message + */ + setMessage(message) { + this['message'] = message; + } +/** + * @return {module:sendx/model/Contact} + */ + getData() { + return this.data; + } + + /** + * @param {module:sendx/model/Contact} data + */ + setData(data) { + this['data'] = data; + } + +} + + + +/** + * @member {String} status + */ +IdentifyResponse.prototype['status'] = undefined; + +/** + * @member {String} message + */ +IdentifyResponse.prototype['message'] = undefined; + +/** + * @member {module:sendx/model/Contact} data + */ +IdentifyResponse.prototype['data'] = undefined; + + + + + + +export default IdentifyResponse; + diff --git a/src/sendx/model/RevenueEventRequest.js b/src/sendx/model/RevenueEventRequest.js new file mode 100644 index 0000000..6e3c510 --- /dev/null +++ b/src/sendx/model/RevenueEventRequest.js @@ -0,0 +1,223 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The RevenueEventRequest model module. + * @module sendx/model/RevenueEventRequest + * @version 1.0.0 + */ +class RevenueEventRequest { + /** + * Constructs a new RevenueEventRequest. + * @alias module:sendx/model/RevenueEventRequest + * @param identifier {String} Unique identifier for the contact. + * @param amount {Number} Recognized revenue amount associated with the event. + * @param currency {String} Currency code (ISO 4217) for the revenue (e.g., 'USD', 'EUR', 'INR'). + * @param source {String} Source of the revenue (e.g., 'website', 'mobile app', 'partner referral'). + * @param time {Number} Unix timestamp indicating when the revenue event occurred. + */ + constructor(identifier, amount, currency, source, time) { + + RevenueEventRequest.initialize(this, identifier, amount, currency, source, time); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj, identifier, amount, currency, source, time) { + obj['identifier'] = identifier; + obj['amount'] = amount; + obj['currency'] = currency; + obj['source'] = source; + obj['time'] = time; + } + + /** + * Constructs a RevenueEventRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:sendx/model/RevenueEventRequest} obj Optional instance to populate. + * @return {module:sendx/model/RevenueEventRequest} The populated RevenueEventRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new RevenueEventRequest(); + + if (data.hasOwnProperty('identifier')) { + obj['identifier'] = ApiClient.convertToType(data['identifier'], 'String'); + } + if (data.hasOwnProperty('amount')) { + obj['amount'] = ApiClient.convertToType(data['amount'], 'Number'); + } + if (data.hasOwnProperty('currency')) { + obj['currency'] = ApiClient.convertToType(data['currency'], 'String'); + } + if (data.hasOwnProperty('source')) { + obj['source'] = ApiClient.convertToType(data['source'], 'String'); + } + if (data.hasOwnProperty('time')) { + obj['time'] = ApiClient.convertToType(data['time'], 'Number'); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to RevenueEventRequest. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to RevenueEventRequest. + */ + static validateJSON(data) { + // check to make sure all required properties are present in the JSON string + for (const property of RevenueEventRequest.RequiredProperties) { + if (!data.hasOwnProperty(property)) { + throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data)); + } + } + // ensure the json data is a string + if (data['identifier'] && !(typeof data['identifier'] === 'string' || data['identifier'] instanceof String)) { + throw new Error("Expected the field `identifier` to be a primitive type in the JSON string but got " + data['identifier']); + } + // ensure the json data is a string + if (data['currency'] && !(typeof data['currency'] === 'string' || data['currency'] instanceof String)) { + throw new Error("Expected the field `currency` to be a primitive type in the JSON string but got " + data['currency']); + } + // ensure the json data is a string + if (data['source'] && !(typeof data['source'] === 'string' || data['source'] instanceof String)) { + throw new Error("Expected the field `source` to be a primitive type in the JSON string but got " + data['source']); + } + + return true; + } + +/** + * Returns Unique identifier for the contact. + * @return {String} + */ + getIdentifier() { + return this.identifier; + } + + /** + * Sets Unique identifier for the contact. + * @param {String} identifier Unique identifier for the contact. + */ + setIdentifier(identifier) { + this['identifier'] = identifier; + } +/** + * Returns Recognized revenue amount associated with the event. + * @return {Number} + */ + getAmount() { + return this.amount; + } + + /** + * Sets Recognized revenue amount associated with the event. + * @param {Number} amount Recognized revenue amount associated with the event. + */ + setAmount(amount) { + this['amount'] = amount; + } +/** + * Returns Currency code (ISO 4217) for the revenue (e.g., 'USD', 'EUR', 'INR'). + * @return {String} + */ + getCurrency() { + return this.currency; + } + + /** + * Sets Currency code (ISO 4217) for the revenue (e.g., 'USD', 'EUR', 'INR'). + * @param {String} currency Currency code (ISO 4217) for the revenue (e.g., 'USD', 'EUR', 'INR'). + */ + setCurrency(currency) { + this['currency'] = currency; + } +/** + * Returns Source of the revenue (e.g., 'website', 'mobile app', 'partner referral'). + * @return {String} + */ + getSource() { + return this.source; + } + + /** + * Sets Source of the revenue (e.g., 'website', 'mobile app', 'partner referral'). + * @param {String} source Source of the revenue (e.g., 'website', 'mobile app', 'partner referral'). + */ + setSource(source) { + this['source'] = source; + } +/** + * Returns Unix timestamp indicating when the revenue event occurred. + * @return {Number} + */ + getTime() { + return this.time; + } + + /** + * Sets Unix timestamp indicating when the revenue event occurred. + * @param {Number} time Unix timestamp indicating when the revenue event occurred. + */ + setTime(time) { + this['time'] = time; + } + +} + +RevenueEventRequest.RequiredProperties = ["identifier", "amount", "currency", "source", "time"]; + +/** + * Unique identifier for the contact. + * @member {String} identifier + */ +RevenueEventRequest.prototype['identifier'] = undefined; + +/** + * Recognized revenue amount associated with the event. + * @member {Number} amount + */ +RevenueEventRequest.prototype['amount'] = undefined; + +/** + * Currency code (ISO 4217) for the revenue (e.g., 'USD', 'EUR', 'INR'). + * @member {String} currency + */ +RevenueEventRequest.prototype['currency'] = undefined; + +/** + * Source of the revenue (e.g., 'website', 'mobile app', 'partner referral'). + * @member {String} source + */ +RevenueEventRequest.prototype['source'] = undefined; + +/** + * Unix timestamp indicating when the revenue event occurred. + * @member {Number} time + */ +RevenueEventRequest.prototype['time'] = undefined; + + + + + + +export default RevenueEventRequest; + diff --git a/src/sendx/model/TrackRequest.js b/src/sendx/model/TrackRequest.js new file mode 100644 index 0000000..d11ead7 --- /dev/null +++ b/src/sendx/model/TrackRequest.js @@ -0,0 +1,153 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The TrackRequest model module. + * @module sendx/model/TrackRequest + * @version 1.0.0 + */ +class TrackRequest { + /** + * Constructs a new TrackRequest. + * @alias module:sendx/model/TrackRequest + */ + constructor() { + + TrackRequest.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a TrackRequest from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:sendx/model/TrackRequest} obj Optional instance to populate. + * @return {module:sendx/model/TrackRequest} The populated TrackRequest instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new TrackRequest(); + + if (data.hasOwnProperty('email')) { + obj['email'] = ApiClient.convertToType(data['email'], 'String'); + } + if (data.hasOwnProperty('addTags')) { + obj['addTags'] = ApiClient.convertToType(data['addTags'], ['String']); + } + if (data.hasOwnProperty('removeTags')) { + obj['removeTags'] = ApiClient.convertToType(data['removeTags'], ['String']); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to TrackRequest. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to TrackRequest. + */ + static validateJSON(data) { + // ensure the json data is a string + if (data['email'] && !(typeof data['email'] === 'string' || data['email'] instanceof String)) { + throw new Error("Expected the field `email` to be a primitive type in the JSON string but got " + data['email']); + } + // ensure the json data is an array + if (!Array.isArray(data['addTags'])) { + throw new Error("Expected the field `addTags` to be an array in the JSON data but got " + data['addTags']); + } + // ensure the json data is an array + if (!Array.isArray(data['removeTags'])) { + throw new Error("Expected the field `removeTags` to be an array in the JSON data but got " + data['removeTags']); + } + + return true; + } + +/** + * Returns Email address of the contact to track. + * @return {String} + */ + getEmail() { + return this.email; + } + + /** + * Sets Email address of the contact to track. + * @param {String} email Email address of the contact to track. + */ + setEmail(email) { + this['email'] = email; + } +/** + * @return {Array.} + */ + getAddTags() { + return this.addTags; + } + + /** + * @param {Array.} addTags + */ + setAddTags(addTags) { + this['addTags'] = addTags; + } +/** + * @return {Array.} + */ + getRemoveTags() { + return this.removeTags; + } + + /** + * @param {Array.} removeTags + */ + setRemoveTags(removeTags) { + this['removeTags'] = removeTags; + } + +} + + + +/** + * Email address of the contact to track. + * @member {String} email + */ +TrackRequest.prototype['email'] = undefined; + +/** + * @member {Array.} addTags + */ +TrackRequest.prototype['addTags'] = undefined; + +/** + * @member {Array.} removeTags + */ +TrackRequest.prototype['removeTags'] = undefined; + + + + + + +export default TrackRequest; + diff --git a/src/sendx/model/TrackResponse.js b/src/sendx/model/TrackResponse.js new file mode 100644 index 0000000..3f67822 --- /dev/null +++ b/src/sendx/model/TrackResponse.js @@ -0,0 +1,125 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +import ApiClient from '../ApiClient'; + +/** + * The TrackResponse model module. + * @module sendx/model/TrackResponse + * @version 1.0.0 + */ +class TrackResponse { + /** + * Constructs a new TrackResponse. + * @alias module:sendx/model/TrackResponse + */ + constructor() { + + TrackResponse.initialize(this); + } + + /** + * Initializes the fields of this object. + * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins). + * Only for internal use. + */ + static initialize(obj) { + } + + /** + * Constructs a TrackResponse from a plain JavaScript object, optionally creating a new instance. + * Copies all relevant properties from data to obj if supplied or a new instance if not. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @param {module:sendx/model/TrackResponse} obj Optional instance to populate. + * @return {module:sendx/model/TrackResponse} The populated TrackResponse instance. + */ + static constructFromObject(data, obj) { + if (data) { + obj = obj || new TrackResponse(); + + if (data.hasOwnProperty('status')) { + obj['status'] = ApiClient.convertToType(data['status'], 'String'); + } + if (data.hasOwnProperty('message')) { + obj['message'] = ApiClient.convertToType(data['message'], 'String'); + } + } + return obj; + } + + /** + * Validates the JSON data with respect to TrackResponse. + * @param {Object} data The plain JavaScript object bearing properties of interest. + * @return {boolean} to indicate whether the JSON data is valid with respect to TrackResponse. + */ + static validateJSON(data) { + // ensure the json data is a string + if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) { + throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']); + } + // ensure the json data is a string + if (data['message'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) { + throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']); + } + + return true; + } + +/** + * @return {String} + */ + getStatus() { + return this.status; + } + + /** + * @param {String} status + */ + setStatus(status) { + this['status'] = status; + } +/** + * @return {String} + */ + getMessage() { + return this.message; + } + + /** + * @param {String} message + */ + setMessage(message) { + this['message'] = message; + } + +} + + + +/** + * @member {String} status + */ +TrackResponse.prototype['status'] = undefined; + +/** + * @member {String} message + */ +TrackResponse.prototype['message'] = undefined; + + + + + + +export default TrackResponse; + diff --git a/test/sendx/api/EventApi.spec.js b/test/sendx/api/EventApi.spec.js new file mode 100644 index 0000000..b54af76 --- /dev/null +++ b/test/sendx/api/EventApi.spec.js @@ -0,0 +1,73 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/sendx/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/sendx/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.sendx); + } +}(this, function(expect, sendx) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new sendx.EventApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('EventApi', function() { + describe('createRevenueEvent', function() { + it('should call createRevenueEvent successfully', function(done) { + //uncomment below and update the code to test createRevenueEvent + //instance.createRevenueEvent(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('pushCustomEvent', function() { + it('should call pushCustomEvent successfully', function(done) { + //uncomment below and update the code to test pushCustomEvent + //instance.pushCustomEvent(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/test/sendx/api/GettingStartedApi.spec.js b/test/sendx/api/GettingStartedApi.spec.js new file mode 100644 index 0000000..38fd25a --- /dev/null +++ b/test/sendx/api/GettingStartedApi.spec.js @@ -0,0 +1,73 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/sendx/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/sendx/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.sendx); + } +}(this, function(expect, sendx) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new sendx.GettingStartedApi(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('GettingStartedApi', function() { + describe('identifyContact', function() { + it('should call identifyContact successfully', function(done) { + //uncomment below and update the code to test identifyContact + //instance.identifyContact(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + describe('trackingContact', function() { + it('should call trackingContact successfully', function(done) { + //uncomment below and update the code to test trackingContact + //instance.trackingContact(function(error) { + // if (error) throw error; + //expect().to.be(); + //}); + done(); + }); + }); + }); + +})); diff --git a/test/sendx/model/CustomEventRequest.spec.js b/test/sendx/model/CustomEventRequest.spec.js new file mode 100644 index 0000000..8ce29dd --- /dev/null +++ b/test/sendx/model/CustomEventRequest.spec.js @@ -0,0 +1,83 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/sendx/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/sendx/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.sendx); + } +}(this, function(expect, sendx) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new sendx.CustomEventRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('CustomEventRequest', function() { + it('should create an instance of CustomEventRequest', function() { + // uncomment below and update the code to test CustomEventRequest + //var instance = new sendx.CustomEventRequest(); + //expect(instance).to.be.a(sendx.CustomEventRequest); + }); + + it('should have the property name (base name: "name")', function() { + // uncomment below and update the code to test the property name + //var instance = new sendx.CustomEventRequest(); + //expect(instance).to.be(); + }); + + it('should have the property identifier (base name: "identifier")', function() { + // uncomment below and update the code to test the property identifier + //var instance = new sendx.CustomEventRequest(); + //expect(instance).to.be(); + }); + + it('should have the property data (base name: "data")', function() { + // uncomment below and update the code to test the property data + //var instance = new sendx.CustomEventRequest(); + //expect(instance).to.be(); + }); + + it('should have the property time (base name: "time")', function() { + // uncomment below and update the code to test the property time + //var instance = new sendx.CustomEventRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/sendx/model/EventResponse.spec.js b/test/sendx/model/EventResponse.spec.js new file mode 100644 index 0000000..3dd58d3 --- /dev/null +++ b/test/sendx/model/EventResponse.spec.js @@ -0,0 +1,77 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/sendx/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/sendx/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.sendx); + } +}(this, function(expect, sendx) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new sendx.EventResponse(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('EventResponse', function() { + it('should create an instance of EventResponse', function() { + // uncomment below and update the code to test EventResponse + //var instance = new sendx.EventResponse(); + //expect(instance).to.be.a(sendx.EventResponse); + }); + + it('should have the property eventId (base name: "event_id")', function() { + // uncomment below and update the code to test the property eventId + //var instance = new sendx.EventResponse(); + //expect(instance).to.be(); + }); + + it('should have the property status (base name: "status")', function() { + // uncomment below and update the code to test the property status + //var instance = new sendx.EventResponse(); + //expect(instance).to.be(); + }); + + it('should have the property message (base name: "message")', function() { + // uncomment below and update the code to test the property message + //var instance = new sendx.EventResponse(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/sendx/model/IdentifyRequest.spec.js b/test/sendx/model/IdentifyRequest.spec.js new file mode 100644 index 0000000..7f4825c --- /dev/null +++ b/test/sendx/model/IdentifyRequest.spec.js @@ -0,0 +1,101 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/sendx/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/sendx/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.sendx); + } +}(this, function(expect, sendx) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new sendx.IdentifyRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('IdentifyRequest', function() { + it('should create an instance of IdentifyRequest', function() { + // uncomment below and update the code to test IdentifyRequest + //var instance = new sendx.IdentifyRequest(); + //expect(instance).to.be.a(sendx.IdentifyRequest); + }); + + it('should have the property firstName (base name: "firstName")', function() { + // uncomment below and update the code to test the property firstName + //var instance = new sendx.IdentifyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property lastName (base name: "lastName")', function() { + // uncomment below and update the code to test the property lastName + //var instance = new sendx.IdentifyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property email (base name: "email")', function() { + // uncomment below and update the code to test the property email + //var instance = new sendx.IdentifyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property newEmail (base name: "newEmail")', function() { + // uncomment below and update the code to test the property newEmail + //var instance = new sendx.IdentifyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property company (base name: "company")', function() { + // uncomment below and update the code to test the property company + //var instance = new sendx.IdentifyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property tags (base name: "tags")', function() { + // uncomment below and update the code to test the property tags + //var instance = new sendx.IdentifyRequest(); + //expect(instance).to.be(); + }); + + it('should have the property customFields (base name: "customFields")', function() { + // uncomment below and update the code to test the property customFields + //var instance = new sendx.IdentifyRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/sendx/model/IdentifyResponse.spec.js b/test/sendx/model/IdentifyResponse.spec.js new file mode 100644 index 0000000..6805272 --- /dev/null +++ b/test/sendx/model/IdentifyResponse.spec.js @@ -0,0 +1,77 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/sendx/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/sendx/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.sendx); + } +}(this, function(expect, sendx) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new sendx.IdentifyResponse(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('IdentifyResponse', function() { + it('should create an instance of IdentifyResponse', function() { + // uncomment below and update the code to test IdentifyResponse + //var instance = new sendx.IdentifyResponse(); + //expect(instance).to.be.a(sendx.IdentifyResponse); + }); + + it('should have the property status (base name: "status")', function() { + // uncomment below and update the code to test the property status + //var instance = new sendx.IdentifyResponse(); + //expect(instance).to.be(); + }); + + it('should have the property message (base name: "message")', function() { + // uncomment below and update the code to test the property message + //var instance = new sendx.IdentifyResponse(); + //expect(instance).to.be(); + }); + + it('should have the property data (base name: "data")', function() { + // uncomment below and update the code to test the property data + //var instance = new sendx.IdentifyResponse(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/sendx/model/RevenueEventRequest.spec.js b/test/sendx/model/RevenueEventRequest.spec.js new file mode 100644 index 0000000..80b27d6 --- /dev/null +++ b/test/sendx/model/RevenueEventRequest.spec.js @@ -0,0 +1,89 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/sendx/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/sendx/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.sendx); + } +}(this, function(expect, sendx) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new sendx.RevenueEventRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('RevenueEventRequest', function() { + it('should create an instance of RevenueEventRequest', function() { + // uncomment below and update the code to test RevenueEventRequest + //var instance = new sendx.RevenueEventRequest(); + //expect(instance).to.be.a(sendx.RevenueEventRequest); + }); + + it('should have the property identifier (base name: "identifier")', function() { + // uncomment below and update the code to test the property identifier + //var instance = new sendx.RevenueEventRequest(); + //expect(instance).to.be(); + }); + + it('should have the property amount (base name: "amount")', function() { + // uncomment below and update the code to test the property amount + //var instance = new sendx.RevenueEventRequest(); + //expect(instance).to.be(); + }); + + it('should have the property currency (base name: "currency")', function() { + // uncomment below and update the code to test the property currency + //var instance = new sendx.RevenueEventRequest(); + //expect(instance).to.be(); + }); + + it('should have the property source (base name: "source")', function() { + // uncomment below and update the code to test the property source + //var instance = new sendx.RevenueEventRequest(); + //expect(instance).to.be(); + }); + + it('should have the property time (base name: "time")', function() { + // uncomment below and update the code to test the property time + //var instance = new sendx.RevenueEventRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/sendx/model/TrackRequest.spec.js b/test/sendx/model/TrackRequest.spec.js new file mode 100644 index 0000000..e819368 --- /dev/null +++ b/test/sendx/model/TrackRequest.spec.js @@ -0,0 +1,77 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/sendx/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/sendx/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.sendx); + } +}(this, function(expect, sendx) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new sendx.TrackRequest(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TrackRequest', function() { + it('should create an instance of TrackRequest', function() { + // uncomment below and update the code to test TrackRequest + //var instance = new sendx.TrackRequest(); + //expect(instance).to.be.a(sendx.TrackRequest); + }); + + it('should have the property email (base name: "email")', function() { + // uncomment below and update the code to test the property email + //var instance = new sendx.TrackRequest(); + //expect(instance).to.be(); + }); + + it('should have the property addTags (base name: "addTags")', function() { + // uncomment below and update the code to test the property addTags + //var instance = new sendx.TrackRequest(); + //expect(instance).to.be(); + }); + + it('should have the property removeTags (base name: "removeTags")', function() { + // uncomment below and update the code to test the property removeTags + //var instance = new sendx.TrackRequest(); + //expect(instance).to.be(); + }); + + }); + +})); diff --git a/test/sendx/model/TrackResponse.spec.js b/test/sendx/model/TrackResponse.spec.js new file mode 100644 index 0000000..b2caea5 --- /dev/null +++ b/test/sendx/model/TrackResponse.spec.js @@ -0,0 +1,71 @@ +/** + * SendX REST API + * # Introduction SendX is an email marketing product. It helps you convert website visitors to customers, send them promotional emails, engage with them using drip sequences and craft custom journeys using powerful but simple automations. The SendX API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. The SendX Rest API doesn’t support bulk updates. You can work on only one object per request.
+ * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@sendx.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', process.cwd()+'/src/sendx/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require(process.cwd()+'/src/sendx/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.sendx); + } +}(this, function(expect, sendx) { + 'use strict'; + + var instance; + + beforeEach(function() { + instance = new sendx.TrackResponse(); + }); + + var getProperty = function(object, getter, property) { + // Use getter method if present; otherwise, get the property directly. + if (typeof object[getter] === 'function') + return object[getter](); + else + return object[property]; + } + + var setProperty = function(object, setter, property, value) { + // Use setter method if present; otherwise, set the property directly. + if (typeof object[setter] === 'function') + object[setter](value); + else + object[property] = value; + } + + describe('TrackResponse', function() { + it('should create an instance of TrackResponse', function() { + // uncomment below and update the code to test TrackResponse + //var instance = new sendx.TrackResponse(); + //expect(instance).to.be.a(sendx.TrackResponse); + }); + + it('should have the property status (base name: "status")', function() { + // uncomment below and update the code to test the property status + //var instance = new sendx.TrackResponse(); + //expect(instance).to.be(); + }); + + it('should have the property message (base name: "message")', function() { + // uncomment below and update the code to test the property message + //var instance = new sendx.TrackResponse(); + //expect(instance).to.be(); + }); + + }); + +}));