Skip to content

Commit 08bbed7

Browse files
authored
Merge pull request #61 from sendinblue/feature_update-wrap_AP-408
New reseller route to update settings of reseller's child account
2 parents 9663ee8 + 84d0e4b commit 08bbed7

11 files changed

+345
-17
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ Class | Method | HTTP request | Description
183183
*SibApiV3Sdk.ResellerApi* | [**getChildDomains**](docs/ResellerApi.md#getChildDomains) | **GET** /reseller/children/{childAuthKey}/domains | Gets all the sender domains of a specific child account
184184
*SibApiV3Sdk.ResellerApi* | [**getChildInfo**](docs/ResellerApi.md#getChildInfo) | **GET** /reseller/children/{childAuthKey} | Gets the info about a specific child account
185185
*SibApiV3Sdk.ResellerApi* | [**getResellerChilds**](docs/ResellerApi.md#getResellerChilds) | **GET** /reseller/children | Gets the list of all reseller's children accounts
186-
*SibApiV3Sdk.ResellerApi* | [**getSsoToken**](docs/ResellerApi.md#getSsoToken) | **GET** /reseller/children/{childAuthKey}/auth | Generates a session token which will remain valid for a short period of time only.
186+
*SibApiV3Sdk.ResellerApi* | [**getSsoToken**](docs/ResellerApi.md#getSsoToken) | **GET** /reseller/children/{childAuthKey}/auth | Get session token to access Sendinblue (SSO)
187187
*SibApiV3Sdk.ResellerApi* | [**removeCredits**](docs/ResellerApi.md#removeCredits) | **POST** /reseller/children/{childAuthKey}/credits/remove | Remove Email and/or SMS credits from a specific child account
188+
*SibApiV3Sdk.ResellerApi* | [**updateChildAccountStatus**](docs/ResellerApi.md#updateChildAccountStatus) | **PUT** /reseller/children/{childAuthKey}/accountStatus | Updates infos of reseller's child account status based on the childAuthKey supplied
188189
*SibApiV3Sdk.ResellerApi* | [**updateChildDomain**](docs/ResellerApi.md#updateChildDomain) | **PUT** /reseller/children/{childAuthKey}/domains/{domainName} | Updates the sender domain of reseller's child based on the childAuthKey and domainName passed
189190
*SibApiV3Sdk.ResellerApi* | [**updateResellerChild**](docs/ResellerApi.md#updateResellerChild) | **PUT** /reseller/children/{childAuthKey} | Updates infos of reseller's child based on the childAuthKey supplied
190191
*SibApiV3Sdk.SMSCampaignsApi* | [**createSmsCampaign**](docs/SMSCampaignsApi.md#createSmsCampaign) | **POST** /smsCampaigns | Creates an SMS campaign
@@ -363,6 +364,7 @@ Class | Method | HTTP request | Description
363364
- [SibApiV3Sdk.UpdateAttributeEnumeration](docs/UpdateAttributeEnumeration.md)
364365
- [SibApiV3Sdk.UpdateCampaignStatus](docs/UpdateCampaignStatus.md)
365366
- [SibApiV3Sdk.UpdateChild](docs/UpdateChild.md)
367+
- [SibApiV3Sdk.UpdateChildAccountStatus](docs/UpdateChildAccountStatus.md)
366368
- [SibApiV3Sdk.UpdateChildDomain](docs/UpdateChildDomain.md)
367369
- [SibApiV3Sdk.UpdateContact](docs/UpdateContact.md)
368370
- [SibApiV3Sdk.UpdateEmailCampaign](docs/UpdateEmailCampaign.md)

docs/ContactsApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ apiInstance.getContactInfo(email).then(function(data) {
617617

618618
Name | Type | Description | Notes
619619
------------- | ------------- | ------------- | -------------
620-
**email** | **String**| Email (urlencoded) of the contact |
620+
**email** | **String**| Email (urlencoded) of the contact OR its SMS attribute value |
621621

622622
### Return type
623623

docs/ResellerApi.md

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ Method | HTTP request | Description
1414
[**getChildDomains**](ResellerApi.md#getChildDomains) | **GET** /reseller/children/{childAuthKey}/domains | Gets all the sender domains of a specific child account
1515
[**getChildInfo**](ResellerApi.md#getChildInfo) | **GET** /reseller/children/{childAuthKey} | Gets the info about a specific child account
1616
[**getResellerChilds**](ResellerApi.md#getResellerChilds) | **GET** /reseller/children | Gets the list of all reseller's children accounts
17-
[**getSsoToken**](ResellerApi.md#getSsoToken) | **GET** /reseller/children/{childAuthKey}/auth | Generates a session token which will remain valid for a short period of time only.
17+
[**getSsoToken**](ResellerApi.md#getSsoToken) | **GET** /reseller/children/{childAuthKey}/auth | Get session token to access Sendinblue (SSO)
1818
[**removeCredits**](ResellerApi.md#removeCredits) | **POST** /reseller/children/{childAuthKey}/credits/remove | Remove Email and/or SMS credits from a specific child account
19+
[**updateChildAccountStatus**](ResellerApi.md#updateChildAccountStatus) | **PUT** /reseller/children/{childAuthKey}/accountStatus | Updates infos of reseller's child account status based on the childAuthKey supplied
1920
[**updateChildDomain**](ResellerApi.md#updateChildDomain) | **PUT** /reseller/children/{childAuthKey}/domains/{domainName} | Updates the sender domain of reseller's child based on the childAuthKey and domainName passed
2021
[**updateResellerChild**](ResellerApi.md#updateResellerChild) | **PUT** /reseller/children/{childAuthKey} | Updates infos of reseller's child based on the childAuthKey supplied
2122

@@ -574,7 +575,9 @@ This endpoint does not need any parameter.
574575
# **getSsoToken**
575576
> GetSsoToken getSsoToken(childAuthKey)
576577
577-
Generates a session token which will remain valid for a short period of time only.
578+
Get session token to access Sendinblue (SSO)
579+
580+
It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern => https:/email.mydomain.com/login/sso?token=[token]
578581

579582
### Example
580583
```javascript
@@ -639,7 +642,7 @@ var defaultClient = SibApiV3Sdk.ApiClient.instance;
639642
var apiKey = defaultClient.authentications['api-key'];
640643
apiKey.apiKey = 'YOUR API KEY';
641644
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
642-
//apikey.apiKeyPrefix = 'Token';
645+
//apiKey.apiKeyPrefix = 'Token';
643646

644647
// Configure API key authorization: partner-key
645648
var partnerKey = defaultClient.authentications['partner-key'];
@@ -676,6 +679,63 @@ Name | Type | Description | Notes
676679

677680
[api-key](../README.md#api-key), [partner-key](../README.md#partner-key)
678681

682+
### HTTP request headers
683+
684+
- **Content-Type**: application/json
685+
- **Accept**: application/json
686+
687+
<a name="updateChildAccountStatus"></a>
688+
# **updateChildAccountStatus**
689+
> updateChildAccountStatus(childAuthKey, updateChildAccountStatus)
690+
691+
Updates infos of reseller&#39;s child account status based on the childAuthKey supplied
692+
693+
### Example
694+
```javascript
695+
var SibApiV3Sdk = require('sib-api-v3-sdk');
696+
var defaultClient = SibApiV3Sdk.ApiClient.instance;
697+
698+
// Configure API key authorization: api-key
699+
var apiKey = defaultClient.authentications['api-key'];
700+
apiKey.apiKey = 'YOUR API KEY';
701+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
702+
//apiKey.apiKeyPrefix = 'Token';
703+
704+
// Configure API key authorization: partner-key
705+
var partnerKey = defaultClient.authentications['partner-key'];
706+
partnerKey.apiKey = 'YOUR API KEY';
707+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
708+
//partnerKey.apiKeyPrefix = 'Token';
709+
710+
var apiInstance = new SibApiV3Sdk.ResellerApi();
711+
712+
var childAuthKey = "childAuthKey_example"; // String | auth key of reseller's child
713+
714+
var updateChildAccountStatus = new SibApiV3Sdk.UpdateChildAccountStatus(); // UpdateChildAccountStatus | values to update in child account status
715+
716+
apiInstance.updateChildAccountStatus(childAuthKey, updateChildAccountStatus).then(function() {
717+
console.log('API called successfully.');
718+
}, function(error) {
719+
console.error(error);
720+
});
721+
722+
```
723+
724+
### Parameters
725+
726+
Name | Type | Description | Notes
727+
------------- | ------------- | ------------- | -------------
728+
**childAuthKey** | **String**| auth key of reseller&#39;s child |
729+
**updateChildAccountStatus** | [**UpdateChildAccountStatus**](UpdateChildAccountStatus.md)| values to update in child account status |
730+
731+
### Return type
732+
733+
null (empty response body)
734+
735+
### Authorization
736+
737+
[api-key](../README.md#api-key), [partner-key](../README.md#partner-key)
738+
679739
### HTTP request headers
680740

681741
- **Content-Type**: application/json

docs/UpdateChildAccountStatus.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SibApiV3Sdk.UpdateChildAccountStatus
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**transactionalEmail** | **Boolean** | Status of Transactional Email (SMTP) Platform activation for your account (true&#x3D;enabled, false&#x3D;disabled) | [optional]
7+
**transactionalSms** | **Boolean** | Status of Transactional SMS Platform activation for your account (true&#x3D;enabled, false&#x3D;disabled) | [optional]
8+
**marketingAutomation** | **Boolean** | Status of Marketing Automation Platform activation for your account (true&#x3D;enabled, false&#x3D;disabled) | [optional]
9+
10+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sib-api-v3-sdk",
3-
"version": "7.1.3",
3+
"version": "7.1.4",
44
"description": "Official SendinBlue provided RESTFul API V3 nodejs library",
55
"license": "ISC",
66
"main": "src/index.js",

src/api/ContactsApi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@
580580

581581
/**
582582
* Retrieves contact informations
583-
* @param {String} email Email (urlencoded) of the contact
583+
* @param {String} email Email (urlencoded) of the contact OR its SMS attribute value
584584
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetExtendedContactDetails} and HTTP response
585585
*/
586586
this.getContactInfoWithHttpInfo = function(email) {
@@ -618,7 +618,7 @@
618618

619619
/**
620620
* Retrieves contact informations
621-
* @param {String} email Email (urlencoded) of the contact
621+
* @param {String} email Email (urlencoded) of the contact OR its SMS attribute value
622622
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetExtendedContactDetails}
623623
*/
624624
this.getContactInfo = function(email) {

src/api/ResellerApi.js

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@
1717
(function(root, factory) {
1818
if (typeof define === 'function' && define.amd) {
1919
// AMD. Register as an anonymous module.
20-
define(['ApiClient', 'model/AddChildDomain', 'model/AddCredits', 'model/CreateChild', 'model/CreateReseller', 'model/ErrorModel', 'model/GetChildDomains', 'model/GetChildInfo', 'model/GetChildrenList', 'model/GetSsoToken', 'model/ManageIp', 'model/RemainingCreditModel', 'model/RemoveCredits', 'model/UpdateChild', 'model/UpdateChildDomain'], factory);
20+
define(['ApiClient', 'model/AddChildDomain', 'model/AddCredits', 'model/CreateChild', 'model/CreateReseller', 'model/ErrorModel', 'model/GetChildDomains', 'model/GetChildInfo', 'model/GetChildrenList', 'model/GetSsoToken', 'model/ManageIp', 'model/RemainingCreditModel', 'model/RemoveCredits', 'model/UpdateChild', 'model/UpdateChildAccountStatus', 'model/UpdateChildDomain'], factory);
2121
} else if (typeof module === 'object' && module.exports) {
2222
// CommonJS-like environments that support module.exports, like Node.
23-
module.exports = factory(require('../ApiClient'), require('../model/AddChildDomain'), require('../model/AddCredits'), require('../model/CreateChild'), require('../model/CreateReseller'), require('../model/ErrorModel'), require('../model/GetChildDomains'), require('../model/GetChildInfo'), require('../model/GetChildrenList'), require('../model/GetSsoToken'), require('../model/ManageIp'), require('../model/RemainingCreditModel'), require('../model/RemoveCredits'), require('../model/UpdateChild'), require('../model/UpdateChildDomain'));
23+
module.exports = factory(require('../ApiClient'), require('../model/AddChildDomain'), require('../model/AddCredits'), require('../model/CreateChild'), require('../model/CreateReseller'), require('../model/ErrorModel'), require('../model/GetChildDomains'), require('../model/GetChildInfo'), require('../model/GetChildrenList'), require('../model/GetSsoToken'), require('../model/ManageIp'), require('../model/RemainingCreditModel'), require('../model/RemoveCredits'), require('../model/UpdateChild'), require('../model/UpdateChildAccountStatus'), require('../model/UpdateChildDomain'));
2424
} else {
2525
// Browser globals (root is window)
2626
if (!root.SibApiV3Sdk) {
2727
root.SibApiV3Sdk = {};
2828
}
29-
root.SibApiV3Sdk.ResellerApi = factory(root.SibApiV3Sdk.ApiClient, root.SibApiV3Sdk.AddChildDomain, root.SibApiV3Sdk.AddCredits, root.SibApiV3Sdk.CreateChild, root.SibApiV3Sdk.CreateReseller, root.SibApiV3Sdk.ErrorModel, root.SibApiV3Sdk.GetChildDomains, root.SibApiV3Sdk.GetChildInfo, root.SibApiV3Sdk.GetChildrenList, root.SibApiV3Sdk.GetSsoToken, root.SibApiV3Sdk.ManageIp, root.SibApiV3Sdk.RemainingCreditModel, root.SibApiV3Sdk.RemoveCredits, root.SibApiV3Sdk.UpdateChild, root.SibApiV3Sdk.UpdateChildDomain);
29+
root.SibApiV3Sdk.ResellerApi = factory(root.SibApiV3Sdk.ApiClient, root.SibApiV3Sdk.AddChildDomain, root.SibApiV3Sdk.AddCredits, root.SibApiV3Sdk.CreateChild, root.SibApiV3Sdk.CreateReseller, root.SibApiV3Sdk.ErrorModel, root.SibApiV3Sdk.GetChildDomains, root.SibApiV3Sdk.GetChildInfo, root.SibApiV3Sdk.GetChildrenList, root.SibApiV3Sdk.GetSsoToken, root.SibApiV3Sdk.ManageIp, root.SibApiV3Sdk.RemainingCreditModel, root.SibApiV3Sdk.RemoveCredits, root.SibApiV3Sdk.UpdateChild, root.SibApiV3Sdk.UpdateChildAccountStatus, root.SibApiV3Sdk.UpdateChildDomain);
3030
}
31-
}(this, function(ApiClient, AddChildDomain, AddCredits, CreateChild, CreateReseller, ErrorModel, GetChildDomains, GetChildInfo, GetChildrenList, GetSsoToken, ManageIp, RemainingCreditModel, RemoveCredits, UpdateChild, UpdateChildDomain) {
31+
}(this, function(ApiClient, AddChildDomain, AddCredits, CreateChild, CreateReseller, ErrorModel, GetChildDomains, GetChildInfo, GetChildrenList, GetSsoToken, ManageIp, RemainingCreditModel, RemoveCredits, UpdateChild, UpdateChildAccountStatus, UpdateChildDomain) {
3232
'use strict';
3333

3434
/**
@@ -585,7 +585,8 @@
585585

586586

587587
/**
588-
* Generates a session token which will remain valid for a short period of time only.
588+
* Get session token to access Sendinblue (SSO)
589+
* It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern &#x3D;&gt; https:/email.mydomain.com/login/sso?token&#x3D;[token]
589590
* @param {String} childAuthKey auth key of reseller&#39;s child
590591
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetSsoToken} and HTTP response
591592
*/
@@ -623,7 +624,8 @@
623624
}
624625

625626
/**
626-
* Generates a session token which will remain valid for a short period of time only.
627+
* Get session token to access Sendinblue (SSO)
628+
* It returns a session [token] which will remain valid for a short period of time. A child account will be able to access a white-labeled section by using the following url pattern &#x3D;&gt; https:/email.mydomain.com/login/sso?token&#x3D;[token]
627629
* @param {String} childAuthKey auth key of reseller&#39;s child
628630
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetSsoToken}
629631
*/
@@ -693,6 +695,64 @@
693695
}
694696

695697

698+
/**
699+
* Updates infos of reseller&#39;s child account status based on the childAuthKey supplied
700+
* @param {String} childAuthKey auth key of reseller&#39;s child
701+
* @param {module:model/UpdateChildAccountStatus} updateChildAccountStatus values to update in child account status
702+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
703+
*/
704+
this.updateChildAccountStatusWithHttpInfo = function(childAuthKey, updateChildAccountStatus) {
705+
var postBody = updateChildAccountStatus;
706+
707+
// verify the required parameter 'childAuthKey' is set
708+
if (childAuthKey === undefined || childAuthKey === null) {
709+
throw new Error("Missing the required parameter 'childAuthKey' when calling updateChildAccountStatus");
710+
}
711+
712+
// verify the required parameter 'updateChildAccountStatus' is set
713+
if (updateChildAccountStatus === undefined || updateChildAccountStatus === null) {
714+
throw new Error("Missing the required parameter 'updateChildAccountStatus' when calling updateChildAccountStatus");
715+
}
716+
717+
718+
var pathParams = {
719+
'childAuthKey': childAuthKey
720+
};
721+
var queryParams = {
722+
};
723+
var collectionQueryParams = {
724+
};
725+
var headerParams = {
726+
};
727+
var formParams = {
728+
};
729+
730+
var authNames = ['api-key', 'partner-key'];
731+
var contentTypes = ['application/json'];
732+
var accepts = ['application/json'];
733+
var returnType = null;
734+
735+
return this.apiClient.callApi(
736+
'/reseller/children/{childAuthKey}/accountStatus', 'PUT',
737+
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
738+
authNames, contentTypes, accepts, returnType
739+
);
740+
}
741+
742+
/**
743+
* Updates infos of reseller&#39;s child account status based on the childAuthKey supplied
744+
* @param {String} childAuthKey auth key of reseller&#39;s child
745+
* @param {module:model/UpdateChildAccountStatus} updateChildAccountStatus values to update in child account status
746+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
747+
*/
748+
this.updateChildAccountStatus = function(childAuthKey, updateChildAccountStatus) {
749+
return this.updateChildAccountStatusWithHttpInfo(childAuthKey, updateChildAccountStatus)
750+
.then(function(response_and_data) {
751+
return response_and_data.data;
752+
});
753+
}
754+
755+
696756
/**
697757
* Updates the sender domain of reseller&#39;s child based on the childAuthKey and domainName passed
698758
* @param {String} childAuthKey auth key of reseller&#39;s child

0 commit comments

Comments
 (0)