Skip to content

Commit e03df3f

Browse files
authored
Merge pull request #30 from sendinblue/feature_mix-updates
Delete single contact method added + get account response fix for reseller
2 parents 8886e0a + 1f7d0d3 commit e03df3f

File tree

9 files changed

+142
-24
lines changed

9 files changed

+142
-24
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SendinBlue's API matches the [OpenAPI v2 definition](https://www.openapis.org/).
99
This library is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project and is reviewed and maintained by SendinBlue:
1010

1111
- API version: 3.0.0
12-
- Package version: 5.0.x
12+
- Package version: 6.0.x
1313
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
1414

1515
## Installation
@@ -120,6 +120,7 @@ Class | Method | HTTP request | Description
120120
*SibApiV3Sdk.ContactsApi* | [**createFolder**](docs/ContactsApi.md#createFolder) | **POST** /contacts/folders | Create a folder
121121
*SibApiV3Sdk.ContactsApi* | [**createList**](docs/ContactsApi.md#createList) | **POST** /contacts/lists | Create a list
122122
*SibApiV3Sdk.ContactsApi* | [**deleteAttribute**](docs/ContactsApi.md#deleteAttribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
123+
*SibApiV3Sdk.ContactsApi* | [**deleteContact**](docs/ContactsApi.md#deleteContact) | **DELETE** /contacts/{email} | Deletes a contact
123124
*SibApiV3Sdk.ContactsApi* | [**deleteFolder**](docs/ContactsApi.md#deleteFolder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
124125
*SibApiV3Sdk.ContactsApi* | [**deleteList**](docs/ContactsApi.md#deleteList) | **DELETE** /contacts/lists/{listId} | Delete a list
125126
*SibApiV3Sdk.ContactsApi* | [**getAttributes**](docs/ContactsApi.md#getAttributes) | **GET** /contacts/attributes | Lists all attributes

docs/ContactsApi.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Method | HTTP request | Description
1010
[**createFolder**](ContactsApi.md#createFolder) | **POST** /contacts/folders | Create a folder
1111
[**createList**](ContactsApi.md#createList) | **POST** /contacts/lists | Create a list
1212
[**deleteAttribute**](ContactsApi.md#deleteAttribute) | **DELETE** /contacts/attributes/{attributeCategory}/{attributeName} | Deletes an attribute
13+
[**deleteContact**](ContactsApi.md#deleteContact) | **DELETE** /contacts/{email} | Deletes a contact
1314
[**deleteFolder**](ContactsApi.md#deleteFolder) | **DELETE** /contacts/folders/{folderId} | Delete a folder (and all its lists)
1415
[**deleteList**](ContactsApi.md#deleteList) | **DELETE** /contacts/lists/{listId} | Delete a list
1516
[**getAttributes**](ContactsApi.md#getAttributes) | **GET** /contacts/attributes | Lists all attributes
@@ -326,6 +327,54 @@ null (empty response body)
326327

327328
[api-key](../README.md#api-key)
328329

330+
### HTTP request headers
331+
332+
- **Content-Type**: application/json
333+
- **Accept**: application/json
334+
335+
<a name="deleteContact"></a>
336+
# **deleteContact**
337+
> deleteContact(email)
338+
339+
Deletes a contact
340+
341+
### Example
342+
```javascript
343+
var SibApiV3Sdk = require('sib-api-v3-sdk');
344+
var defaultClient = SibApiV3Sdk.ApiClient.instance;
345+
346+
// Configure API key authorization: api-key
347+
var apiKey = defaultClient.authentications['api-key'];
348+
apiKey.apiKey = 'YOUR API KEY';
349+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
350+
//apiKey.apiKeyPrefix = 'Token';
351+
352+
var apiInstance = new SibApiV3Sdk.ContactsApi();
353+
354+
var email = "email_example"; // String | Email (urlencoded) of the contact
355+
356+
apiInstance.deleteContact(email).then(function() {
357+
console.log('API called successfully.');
358+
}, function(error) {
359+
console.error(error);
360+
});
361+
362+
```
363+
364+
### Parameters
365+
366+
Name | Type | Description | Notes
367+
------------- | ------------- | ------------- | -------------
368+
**email** | **String**| Email (urlencoded) of the contact |
369+
370+
### Return type
371+
372+
null (empty response body)
373+
374+
### Authorization
375+
376+
[api-key](../README.md#api-key)
377+
329378
### HTTP request headers
330379

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

docs/GetAccountPlan.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**type** | **String** | Displays the plan type of the user |
7-
**creditsType** | **String** | This is the type of the credit, \&quot;User Limit\&quot; or \&quot;Send Limit\&quot; are two possible types of credit of a user. \&quot;User Limit\&quot; implies the total number of subscribers you can add to your account, and \&quot;Send Limit\&quot; implies the total number of emails you can send to the subscribers in your account. |
8-
**credits** | **Number** | Remaining credits of the user. This can either be \&quot;User Limit\&quot; or \&quot;Send Limit\&quot; depending on the plan. |
7+
**creditsType** | **String** | This is the type of the credit, \&quot;Send Limit\&quot; is one of the possible types of credit of a user. \&quot;Send Limit\&quot; implies the total number of emails you can send to the subscribers in your account. |
8+
**credits** | **Number** | Remaining credits of the user |
99
**startDate** | **Date** | Date of the period from which the plan will start (only available for \&quot;subscription\&quot;, \&quot;unlimited\&quot; and \&quot;reseller\&quot; plan type) | [optional]
1010
**endDate** | **Date** | Date of the period from which the plan will end (only available for \&quot;subscription\&quot;, \&quot;unlimited\&quot; and \&quot;reseller\&quot; plan type) | [optional]
11+
**userLimit** | **Number** | Only in case of reseller account. It implies the total number of child accounts you can add to your account. | [optional]
1112

1213

1314
<a name="TypeEnum"></a>
@@ -33,8 +34,6 @@ Name | Type | Description | Notes
3334
## Enum: CreditsTypeEnum
3435

3536

36-
* `userLimit` (value: `"userLimit"`)
37-
3837
* `sendLimit` (value: `"sendLimit"`)
3938

4039

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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": "6.0.0",
3+
"version": "6.0.1",
44
"description": "Official SendinBlue provided RESTFul API V3 nodejs library",
55
"license": "ISC",
66
"main": "src/index.js",

src/api/ContactsApi.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,55 @@
370370
}
371371

372372

373+
/**
374+
* Deletes a contact
375+
* @param {String} email Email (urlencoded) of the contact
376+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
377+
*/
378+
this.deleteContactWithHttpInfo = function(email) {
379+
var postBody = null;
380+
381+
// verify the required parameter 'email' is set
382+
if (email === undefined || email === null) {
383+
throw new Error("Missing the required parameter 'email' when calling deleteContact");
384+
}
385+
386+
387+
var pathParams = {
388+
'email': email
389+
};
390+
var queryParams = {
391+
};
392+
var headerParams = {
393+
};
394+
var formParams = {
395+
};
396+
397+
var authNames = ['api-key'];
398+
var contentTypes = ['application/json'];
399+
var accepts = ['application/json'];
400+
var returnType = null;
401+
402+
return this.apiClient.callApi(
403+
'/contacts/{email}', 'DELETE',
404+
pathParams, queryParams, headerParams, formParams, postBody,
405+
authNames, contentTypes, accepts, returnType
406+
);
407+
}
408+
409+
/**
410+
* Deletes a contact
411+
* @param {String} email Email (urlencoded) of the contact
412+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
413+
*/
414+
this.deleteContact = function(email) {
415+
return this.deleteContactWithHttpInfo(email)
416+
.then(function(response_and_data) {
417+
return response_and_data.data;
418+
});
419+
}
420+
421+
373422
/**
374423
* Delete a folder (and all its lists)
375424
* @param {Number} folderId Id of the folder

src/model/GetAccountPlan.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
* @alias module:model/GetAccountPlan
4646
* @class
4747
* @param type {module:model/GetAccountPlan.TypeEnum} Displays the plan type of the user
48-
* @param creditsType {module:model/GetAccountPlan.CreditsTypeEnum} This is the type of the credit, \"User Limit\" or \"Send Limit\" are two possible types of credit of a user. \"User Limit\" implies the total number of subscribers you can add to your account, and \"Send Limit\" implies the total number of emails you can send to the subscribers in your account.
49-
* @param credits {Number} Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan.
48+
* @param creditsType {module:model/GetAccountPlan.CreditsTypeEnum} This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account.
49+
* @param credits {Number} Remaining credits of the user
5050
*/
5151
var exports = function(type, creditsType, credits) {
5252
var _this = this;
@@ -56,6 +56,7 @@
5656
_this['credits'] = credits;
5757

5858

59+
5960
};
6061

6162
/**
@@ -84,6 +85,9 @@
8485
if (data.hasOwnProperty('endDate')) {
8586
obj['endDate'] = ApiClient.convertToType(data['endDate'], 'Date');
8687
}
88+
if (data.hasOwnProperty('userLimit')) {
89+
obj['userLimit'] = ApiClient.convertToType(data['userLimit'], 'Number');
90+
}
8791
}
8892
return obj;
8993
}
@@ -94,12 +98,12 @@
9498
*/
9599
exports.prototype['type'] = undefined;
96100
/**
97-
* This is the type of the credit, \"User Limit\" or \"Send Limit\" are two possible types of credit of a user. \"User Limit\" implies the total number of subscribers you can add to your account, and \"Send Limit\" implies the total number of emails you can send to the subscribers in your account.
101+
* This is the type of the credit, \"Send Limit\" is one of the possible types of credit of a user. \"Send Limit\" implies the total number of emails you can send to the subscribers in your account.
98102
* @member {module:model/GetAccountPlan.CreditsTypeEnum} creditsType
99103
*/
100104
exports.prototype['creditsType'] = undefined;
101105
/**
102-
* Remaining credits of the user. This can either be \"User Limit\" or \"Send Limit\" depending on the plan.
106+
* Remaining credits of the user
103107
* @member {Number} credits
104108
*/
105109
exports.prototype['credits'] = undefined;
@@ -113,6 +117,11 @@
113117
* @member {Date} endDate
114118
*/
115119
exports.prototype['endDate'] = undefined;
120+
/**
121+
* Only in case of reseller account. It implies the total number of child accounts you can add to your account.
122+
* @member {Number} userLimit
123+
*/
124+
exports.prototype['userLimit'] = undefined;
116125

117126

118127
/**
@@ -158,11 +167,6 @@
158167
* @readonly
159168
*/
160169
exports.CreditsTypeEnum = {
161-
/**
162-
* value: "userLimit"
163-
* @const
164-
*/
165-
"userLimit": "userLimit",
166170
/**
167171
* value: "sendLimit"
168172
* @const

test/api/ContactsApi.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@
111111
done();
112112
});
113113
});
114+
describe('deleteContact', function() {
115+
it('should call deleteContact successfully', function(done) {
116+
//uncomment below and update the code to test deleteContact
117+
//instance.deleteContact(function(error) {
118+
// if (error) throw error;
119+
//expect().to.be();
120+
//});
121+
done();
122+
});
123+
});
114124
describe('deleteFolder', function() {
115125
it('should call deleteFolder successfully', function(done) {
116126
//uncomment below and update the code to test deleteFolder

test/model/GetAccountPlan.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@
8787
//expect(instance).to.be();
8888
});
8989

90+
it('should have the property userLimit (base name: "userLimit")', function() {
91+
// uncomment below and update the code to test the property userLimit
92+
//var instane = new SibApiV3Sdk.GetAccountPlan();
93+
//expect(instance).to.be();
94+
});
95+
9096
});
9197

9298
}));

0 commit comments

Comments
 (0)