Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 214e330

Browse files
author
Engineering at Onfido
committed
New client release: 4.1.0
1 parent 0636d43 commit 214e330

35 files changed

Lines changed: 256 additions & 33 deletions

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The Onfido API is used to submit check requests.
66
This package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
77

88
- API version: 2.0.0
9-
- Package version: 4.0.1
9+
- Package version: 4.1.0
1010
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
1111

1212
## Installation
@@ -131,10 +131,12 @@ Class | Method | HTTP request | Description
131131
*Onfido.DefaultApi* | [**createApplicant**](docs/DefaultApi.md#createApplicant) | **POST** /applicants | Create Applicant
132132
*Onfido.DefaultApi* | [**createCheck**](docs/DefaultApi.md#createCheck) | **POST** /applicants/{applicant_id}/checks | Create a check
133133
*Onfido.DefaultApi* | [**createWebhook**](docs/DefaultApi.md#createWebhook) | **POST** /webhooks | Create a webhook
134+
*Onfido.DefaultApi* | [**deleteWebhook**](docs/DefaultApi.md#deleteWebhook) | **DELETE** /webhooks/{webhook_id} | Delete a webhook
134135
*Onfido.DefaultApi* | [**destroyApplicant**](docs/DefaultApi.md#destroyApplicant) | **DELETE** /applicants/{applicant_id} | Delete Applicant
135136
*Onfido.DefaultApi* | [**downloadDocument**](docs/DefaultApi.md#downloadDocument) | **GET** /applicants/{applicant_id}/documents/{document_id}/download | Download a documents raw data
136137
*Onfido.DefaultApi* | [**downloadLivePhoto**](docs/DefaultApi.md#downloadLivePhoto) | **GET** /live_photos/{live_photo_id}/download | Download live photo
137138
*Onfido.DefaultApi* | [**downloadLiveVideo**](docs/DefaultApi.md#downloadLiveVideo) | **GET** /live_videos/{live_video_id}/download | Download live video
139+
*Onfido.DefaultApi* | [**editWebhook**](docs/DefaultApi.md#editWebhook) | **PUT** /webhooks/{webhook_id} | Edit a webhook
138140
*Onfido.DefaultApi* | [**findAddresses**](docs/DefaultApi.md#findAddresses) | **GET** /addresses/pick | Search for addresses by postcode
139141
*Onfido.DefaultApi* | [**findApplicant**](docs/DefaultApi.md#findApplicant) | **GET** /applicants/{applicant_id} | Retrieve Applicant
140142
*Onfido.DefaultApi* | [**findCheck**](docs/DefaultApi.md#findCheck) | **GET** /applicants/{applicant_id}/checks/{check_id} | Retrieve a Check

docs/DefaultApi.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ Method | HTTP request | Description
88
[**createApplicant**](DefaultApi.md#createApplicant) | **POST** /applicants | Create Applicant
99
[**createCheck**](DefaultApi.md#createCheck) | **POST** /applicants/{applicant_id}/checks | Create a check
1010
[**createWebhook**](DefaultApi.md#createWebhook) | **POST** /webhooks | Create a webhook
11+
[**deleteWebhook**](DefaultApi.md#deleteWebhook) | **DELETE** /webhooks/{webhook_id} | Delete a webhook
1112
[**destroyApplicant**](DefaultApi.md#destroyApplicant) | **DELETE** /applicants/{applicant_id} | Delete Applicant
1213
[**downloadDocument**](DefaultApi.md#downloadDocument) | **GET** /applicants/{applicant_id}/documents/{document_id}/download | Download a documents raw data
1314
[**downloadLivePhoto**](DefaultApi.md#downloadLivePhoto) | **GET** /live_photos/{live_photo_id}/download | Download live photo
1415
[**downloadLiveVideo**](DefaultApi.md#downloadLiveVideo) | **GET** /live_videos/{live_video_id}/download | Download live video
16+
[**editWebhook**](DefaultApi.md#editWebhook) | **PUT** /webhooks/{webhook_id} | Edit a webhook
1517
[**findAddresses**](DefaultApi.md#findAddresses) | **GET** /addresses/pick | Search for addresses by postcode
1618
[**findApplicant**](DefaultApi.md#findApplicant) | **GET** /applicants/{applicant_id} | Retrieve Applicant
1719
[**findCheck**](DefaultApi.md#findCheck) | **GET** /applicants/{applicant_id}/checks/{check_id} | Retrieve a Check
@@ -218,6 +220,50 @@ Name | Type | Description | Notes
218220
- **Content-Type**: application/json
219221
- **Accept**: application/json
220222

223+
<a name="deleteWebhook"></a>
224+
# **deleteWebhook**
225+
> deleteWebhook(webhook_id)
226+
227+
Delete a webhook
228+
229+
### Example
230+
```javascript
231+
var Onfido = require('onfido');
232+
var defaultClient = Onfido.ApiClient.instance;
233+
// Configure API key authorization: Token
234+
const token_auth = defaultClient.authentications['Token'];
235+
token_auth.apiKey = 'token=' + 'YOUR API KEY';
236+
token_auth.apiKeyPrefix = 'Token';
237+
238+
var apiInstance = new Onfido.DefaultApi();
239+
var webhook_id = "webhook_id_example"; // String |
240+
apiInstance.deleteWebhook(webhook_id).then(function() {
241+
console.log('API called successfully.');
242+
}, function(error) {
243+
console.error(error);
244+
});
245+
246+
```
247+
248+
### Parameters
249+
250+
Name | Type | Description | Notes
251+
------------- | ------------- | ------------- | -------------
252+
**webhook_id** | **String**| |
253+
254+
### Return type
255+
256+
null (empty response body)
257+
258+
### Authorization
259+
260+
[Token](../README.md#Token)
261+
262+
### HTTP request headers
263+
264+
- **Content-Type**: Not defined
265+
- **Accept**: application/json
266+
221267
<a name="destroyApplicant"></a>
222268
# **destroyApplicant**
223269
> destroyApplicant(applicant_id)
@@ -400,6 +446,52 @@ Name | Type | Description | Notes
400446
- **Content-Type**: Not defined
401447
- **Accept**: */*, application/json
402448

449+
<a name="editWebhook"></a>
450+
# **editWebhook**
451+
> Webhook editWebhook(webhook_id, Webhook)
452+
453+
Edit a webhook
454+
455+
### Example
456+
```javascript
457+
var Onfido = require('onfido');
458+
var defaultClient = Onfido.ApiClient.instance;
459+
// Configure API key authorization: Token
460+
const token_auth = defaultClient.authentications['Token'];
461+
token_auth.apiKey = 'token=' + 'YOUR API KEY';
462+
token_auth.apiKeyPrefix = 'Token';
463+
464+
var apiInstance = new Onfido.DefaultApi();
465+
var webhook_id = "webhook_id_example"; // String |
466+
var Webhook = new Onfido.Webhook(); // Webhook |
467+
apiInstance.editWebhook(webhook_id, Webhook).then(function(data) {
468+
console.log('API called successfully. Returned data: ' + data);
469+
}, function(error) {
470+
console.error(error);
471+
});
472+
473+
```
474+
475+
### Parameters
476+
477+
Name | Type | Description | Notes
478+
------------- | ------------- | ------------- | -------------
479+
**webhook_id** | **String**| |
480+
**Webhook** | [**Webhook**](Webhook.md)| |
481+
482+
### Return type
483+
484+
[**Webhook**](Webhook.md)
485+
486+
### Authorization
487+
488+
[Token](../README.md#Token)
489+
490+
### HTTP request headers
491+
492+
- **Content-Type**: application/json
493+
- **Accept**: application/json
494+
403495
<a name="findAddresses"></a>
404496
# **findAddresses**
405497
> GenericAddressesList findAddresses(postcode)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "onfido",
3-
"version": "4.0.1",
3+
"version": "4.1.0",
44
"description": "Client library for the Onfido API.",
55
"license": "MIT",
66
"main": "src/index.js",

src/ApiClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
/**
3434
* @module ApiClient
35-
* @version 4.0.1
35+
* @version 4.1.0
3636
*/
3737

3838
/**

src/api/DefaultApi.js

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/**
3434
* Default service.
3535
* @module api/DefaultApi
36-
* @version 4.0.1
36+
* @version 4.1.0
3737
*/
3838

3939
/**
@@ -265,6 +265,57 @@
265265
}
266266

267267

268+
/**
269+
* Delete a webhook
270+
* @param {String} webhook_id
271+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
272+
*/
273+
this.deleteWebhookWithHttpInfo = function(webhook_id) {
274+
var postBody = null;
275+
276+
// verify the required parameter 'webhook_id' is set
277+
if (webhook_id === undefined || webhook_id === null) {
278+
throw new Error("Missing the required parameter 'webhook_id' when calling deleteWebhook");
279+
}
280+
281+
282+
var pathParams = {
283+
'webhook_id': webhook_id
284+
};
285+
var queryParams = {
286+
};
287+
var collectionQueryParams = {
288+
};
289+
var headerParams = {
290+
};
291+
var formParams = {
292+
};
293+
294+
var authNames = ['Token'];
295+
var contentTypes = [];
296+
var accepts = ['application/json'];
297+
var returnType = null;
298+
299+
return this.apiClient.callApi(
300+
'/webhooks/{webhook_id}', 'DELETE',
301+
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
302+
authNames, contentTypes, accepts, returnType
303+
);
304+
}
305+
306+
/**
307+
* Delete a webhook
308+
* @param {String} webhook_id
309+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
310+
*/
311+
this.deleteWebhook = function(webhook_id) {
312+
return this.deleteWebhookWithHttpInfo(webhook_id)
313+
.then(function(response_and_data) {
314+
return response_and_data.data;
315+
});
316+
}
317+
318+
268319
/**
269320
* Delete Applicant
270321
* @param {String} applicant_id
@@ -481,6 +532,64 @@
481532
}
482533

483534

535+
/**
536+
* Edit a webhook
537+
* @param {String} webhook_id
538+
* @param {module:model/Webhook} Webhook
539+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Webhook} and HTTP response
540+
*/
541+
this.editWebhookWithHttpInfo = function(webhook_id, Webhook) {
542+
var postBody = Webhook;
543+
544+
// verify the required parameter 'webhook_id' is set
545+
if (webhook_id === undefined || webhook_id === null) {
546+
throw new Error("Missing the required parameter 'webhook_id' when calling editWebhook");
547+
}
548+
549+
// verify the required parameter 'Webhook' is set
550+
if (Webhook === undefined || Webhook === null) {
551+
throw new Error("Missing the required parameter 'Webhook' when calling editWebhook");
552+
}
553+
554+
555+
var pathParams = {
556+
'webhook_id': webhook_id
557+
};
558+
var queryParams = {
559+
};
560+
var collectionQueryParams = {
561+
};
562+
var headerParams = {
563+
};
564+
var formParams = {
565+
};
566+
567+
var authNames = ['Token'];
568+
var contentTypes = ['application/json'];
569+
var accepts = ['application/json'];
570+
var returnType = Webhook;
571+
572+
return this.apiClient.callApi(
573+
'/webhooks/{webhook_id}', 'PUT',
574+
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
575+
authNames, contentTypes, accepts, returnType
576+
);
577+
}
578+
579+
/**
580+
* Edit a webhook
581+
* @param {String} webhook_id
582+
* @param {module:model/Webhook} Webhook
583+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Webhook}
584+
*/
585+
this.editWebhook = function(webhook_id, Webhook) {
586+
return this.editWebhookWithHttpInfo(webhook_id, Webhook)
587+
.then(function(response_and_data) {
588+
return response_and_data.data;
589+
});
590+
}
591+
592+
484593
/**
485594
* Search for addresses by postcode
486595
* @param {String} postcode

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* </pre>
5454
* </p>
5555
* @module index
56-
* @version 4.0.1
56+
* @version 4.1.0
5757
*/
5858
var exports = {
5959
/**

src/model/Address.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/**
3636
* The Address model module.
3737
* @module model/Address
38-
* @version 4.0.1
38+
* @version 4.1.0
3939
*/
4040

4141
/**

src/model/Applicant.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/**
3636
* The Applicant model module.
3737
* @module model/Applicant
38-
* @version 4.0.1
38+
* @version 4.1.0
3939
*/
4040

4141
/**

src/model/ApplicantsList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/**
3636
* The ApplicantsList model module.
3737
* @module model/ApplicantsList
38-
* @version 4.0.1
38+
* @version 4.1.0
3939
*/
4040

4141
/**

src/model/Check.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
/**
3636
* The Check model module.
3737
* @module model/Check
38-
* @version 4.0.1
38+
* @version 4.1.0
3939
*/
4040

4141
/**

0 commit comments

Comments
 (0)