UNPKG

@namsor/nam_sor_api_v2

Version:

NamSor API v2 : enpoints to process personal names (gender, cultural origin or ethnicity) in all alphabets or languages.

1,207 lines (1,035 loc) 49.8 kB
/** * NamSor API v2 * NamSor API v2 : enpoints to process personal names (gender, cultural origin or ethnicity) in all alphabets or languages. Use GET methods for small tests, but prefer POST methods for higher throughput (batch processing of up to 100 names at a time). Need something you can't find here? We have many more features coming soon. Let us know, we'll do our best to add it! * * OpenAPI spec version: 2.0.11 * Contact: contact@namsor.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * * OpenAPI Generator version: 4.0.0-SNAPSHOT * * Do not edit the class manually. * */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['ApiClient', 'model/BatchFirstLastNameDiasporaedOut', 'model/BatchFirstLastNameGenderedOut', 'model/BatchFirstLastNameGeoIn', 'model/BatchFirstLastNameGeoZippedIn', 'model/BatchFirstLastNameIn', 'model/BatchFirstLastNameOriginedOut', 'model/BatchFirstLastNameUSRaceEthnicityOut', 'model/BatchParsedFullNameGeoIn', 'model/BatchParsedFullNameIn', 'model/BatchPersonalNameGenderedOut', 'model/BatchPersonalNameGeoIn', 'model/BatchPersonalNameGeoOut', 'model/BatchPersonalNameIn', 'model/BatchPersonalNameParsedOut', 'model/FirstLastNameDiasporaedOut', 'model/FirstLastNameGenderedOut', 'model/FirstLastNameOriginedOut', 'model/FirstLastNameUSRaceEthnicityOut', 'model/PersonalNameGenderedOut', 'model/PersonalNameGeoOut', 'model/PersonalNameParsedOut'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'), require('../model/BatchFirstLastNameDiasporaedOut'), require('../model/BatchFirstLastNameGenderedOut'), require('../model/BatchFirstLastNameGeoIn'), require('../model/BatchFirstLastNameGeoZippedIn'), require('../model/BatchFirstLastNameIn'), require('../model/BatchFirstLastNameOriginedOut'), require('../model/BatchFirstLastNameUSRaceEthnicityOut'), require('../model/BatchParsedFullNameGeoIn'), require('../model/BatchParsedFullNameIn'), require('../model/BatchPersonalNameGenderedOut'), require('../model/BatchPersonalNameGeoIn'), require('../model/BatchPersonalNameGeoOut'), require('../model/BatchPersonalNameIn'), require('../model/BatchPersonalNameParsedOut'), require('../model/FirstLastNameDiasporaedOut'), require('../model/FirstLastNameGenderedOut'), require('../model/FirstLastNameOriginedOut'), require('../model/FirstLastNameUSRaceEthnicityOut'), require('../model/PersonalNameGenderedOut'), require('../model/PersonalNameGeoOut'), require('../model/PersonalNameParsedOut')); } else { // Browser globals (root is window) if (!root.NamSorApiV2) { root.NamSorApiV2 = {}; } root.NamSorApiV2.PersonalApi = factory(root.NamSorApiV2.ApiClient, root.NamSorApiV2.BatchFirstLastNameDiasporaedOut, root.NamSorApiV2.BatchFirstLastNameGenderedOut, root.NamSorApiV2.BatchFirstLastNameGeoIn, root.NamSorApiV2.BatchFirstLastNameGeoZippedIn, root.NamSorApiV2.BatchFirstLastNameIn, root.NamSorApiV2.BatchFirstLastNameOriginedOut, root.NamSorApiV2.BatchFirstLastNameUSRaceEthnicityOut, root.NamSorApiV2.BatchParsedFullNameGeoIn, root.NamSorApiV2.BatchParsedFullNameIn, root.NamSorApiV2.BatchPersonalNameGenderedOut, root.NamSorApiV2.BatchPersonalNameGeoIn, root.NamSorApiV2.BatchPersonalNameGeoOut, root.NamSorApiV2.BatchPersonalNameIn, root.NamSorApiV2.BatchPersonalNameParsedOut, root.NamSorApiV2.FirstLastNameDiasporaedOut, root.NamSorApiV2.FirstLastNameGenderedOut, root.NamSorApiV2.FirstLastNameOriginedOut, root.NamSorApiV2.FirstLastNameUSRaceEthnicityOut, root.NamSorApiV2.PersonalNameGenderedOut, root.NamSorApiV2.PersonalNameGeoOut, root.NamSorApiV2.PersonalNameParsedOut); } }(this, function(ApiClient, BatchFirstLastNameDiasporaedOut, BatchFirstLastNameGenderedOut, BatchFirstLastNameGeoIn, BatchFirstLastNameGeoZippedIn, BatchFirstLastNameIn, BatchFirstLastNameOriginedOut, BatchFirstLastNameUSRaceEthnicityOut, BatchParsedFullNameGeoIn, BatchParsedFullNameIn, BatchPersonalNameGenderedOut, BatchPersonalNameGeoIn, BatchPersonalNameGeoOut, BatchPersonalNameIn, BatchPersonalNameParsedOut, FirstLastNameDiasporaedOut, FirstLastNameGenderedOut, FirstLastNameOriginedOut, FirstLastNameUSRaceEthnicityOut, PersonalNameGenderedOut, PersonalNameGeoOut, PersonalNameParsedOut) { 'use strict'; /** * Personal service. * @module api/PersonalApi * @version 2.0.11 */ /** * Constructs a new PersonalApi. * @alias module:api/PersonalApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ var exports = function(apiClient) { this.apiClient = apiClient || ApiClient.instance; /** * Callback function to receive the result of the country operation. * @callback module:api/PersonalApi~countryCallback * @param {String} error Error message, if any. * @param {module:model/PersonalNameGeoOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * [USES 10 UNITS PER NAME] Infer the likely country of residence of a personal full name, or one surname. Assumes names as they are in the country of residence OR the country of origin. * @param {String} personalNameFull * @param {module:api/PersonalApi~countryCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/PersonalNameGeoOut} */ this.country = function(personalNameFull, callback) { var postBody = null; // verify the required parameter 'personalNameFull' is set if (personalNameFull === undefined || personalNameFull === null) { throw new Error("Missing the required parameter 'personalNameFull' when calling country"); } var pathParams = { 'personalNameFull': personalNameFull }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; var returnType = PersonalNameGeoOut; return this.apiClient.callApi( '/api2/json/country/{personalNameFull}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the countryBatch operation. * @callback module:api/PersonalApi~countryBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchPersonalNameGeoOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * [USES 10 UNITS PER NAME] Infer the likely country of residence of up to 100 personal full names, or surnames. Assumes names as they are in the country of residence OR the country of origin. * @param {Object} opts Optional parameters * @param {module:model/BatchPersonalNameIn} opts.batchPersonalNameIn A list of personal names * @param {module:api/PersonalApi~countryBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchPersonalNameGeoOut} */ this.countryBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchPersonalNameIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchPersonalNameGeoOut; return this.apiClient.callApi( '/api2/json/countryBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the diaspora operation. * @callback module:api/PersonalApi~diasporaCallback * @param {String} error Error message, if any. * @param {module:model/FirstLastNameDiasporaedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * [USES 20 UNITS PER NAME] Infer the likely ethnicity/diaspora of a personal name, given a country of residence ISO2 code (ex. US, CA, AU, NZ etc.) * @param {String} countryIso2 * @param {String} firstName * @param {String} lastName * @param {module:api/PersonalApi~diasporaCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/FirstLastNameDiasporaedOut} */ this.diaspora = function(countryIso2, firstName, lastName, callback) { var postBody = null; // verify the required parameter 'countryIso2' is set if (countryIso2 === undefined || countryIso2 === null) { throw new Error("Missing the required parameter 'countryIso2' when calling diaspora"); } // verify the required parameter 'firstName' is set if (firstName === undefined || firstName === null) { throw new Error("Missing the required parameter 'firstName' when calling diaspora"); } // verify the required parameter 'lastName' is set if (lastName === undefined || lastName === null) { throw new Error("Missing the required parameter 'lastName' when calling diaspora"); } var pathParams = { 'countryIso2': countryIso2, 'firstName': firstName, 'lastName': lastName }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; var returnType = FirstLastNameDiasporaedOut; return this.apiClient.callApi( '/api2/json/diaspora/{countryIso2}/{firstName}/{lastName}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the diasporaBatch operation. * @callback module:api/PersonalApi~diasporaBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchFirstLastNameDiasporaedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * [USES 20 UNITS PER NAME] Infer the likely ethnicity/diaspora of up to 100 personal names, given a country of residence ISO2 code (ex. US, CA, AU, NZ etc.) * @param {Object} opts Optional parameters * @param {module:model/BatchFirstLastNameGeoIn} opts.batchFirstLastNameGeoIn A list of personal names * @param {module:api/PersonalApi~diasporaBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchFirstLastNameDiasporaedOut} */ this.diasporaBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchFirstLastNameGeoIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchFirstLastNameDiasporaedOut; return this.apiClient.callApi( '/api2/json/diasporaBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the gender operation. * @callback module:api/PersonalApi~genderCallback * @param {String} error Error message, if any. * @param {module:model/FirstLastNameGenderedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely gender of a name. * @param {String} firstName * @param {String} lastName * @param {module:api/PersonalApi~genderCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/FirstLastNameGenderedOut} */ this.gender = function(firstName, lastName, callback) { var postBody = null; // verify the required parameter 'firstName' is set if (firstName === undefined || firstName === null) { throw new Error("Missing the required parameter 'firstName' when calling gender"); } // verify the required parameter 'lastName' is set if (lastName === undefined || lastName === null) { throw new Error("Missing the required parameter 'lastName' when calling gender"); } var pathParams = { 'firstName': firstName, 'lastName': lastName }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; var returnType = FirstLastNameGenderedOut; return this.apiClient.callApi( '/api2/json/gender/{firstName}/{lastName}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the genderBatch operation. * @callback module:api/PersonalApi~genderBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchFirstLastNameGenderedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely gender of up to 100 names, detecting automatically the cultural context. * @param {Object} opts Optional parameters * @param {module:model/BatchFirstLastNameIn} opts.batchFirstLastNameIn A list of personal names * @param {module:api/PersonalApi~genderBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchFirstLastNameGenderedOut} */ this.genderBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchFirstLastNameIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchFirstLastNameGenderedOut; return this.apiClient.callApi( '/api2/json/genderBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the genderFull operation. * @callback module:api/PersonalApi~genderFullCallback * @param {String} error Error message, if any. * @param {module:model/PersonalNameGenderedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely gender of a full name, ex. John H. Smith * @param {String} fullName * @param {module:api/PersonalApi~genderFullCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/PersonalNameGenderedOut} */ this.genderFull = function(fullName, callback) { var postBody = null; // verify the required parameter 'fullName' is set if (fullName === undefined || fullName === null) { throw new Error("Missing the required parameter 'fullName' when calling genderFull"); } var pathParams = { 'fullName': fullName }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; var returnType = PersonalNameGenderedOut; return this.apiClient.callApi( '/api2/json/genderFull/{fullName}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the genderFullBatch operation. * @callback module:api/PersonalApi~genderFullBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchPersonalNameGenderedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely gender of up to 100 full names, detecting automatically the cultural context. * @param {Object} opts Optional parameters * @param {module:model/BatchPersonalNameIn} opts.batchPersonalNameIn A list of personal names * @param {module:api/PersonalApi~genderFullBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchPersonalNameGenderedOut} */ this.genderFullBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchPersonalNameIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchPersonalNameGenderedOut; return this.apiClient.callApi( '/api2/json/genderFullBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the genderFullGeo operation. * @callback module:api/PersonalApi~genderFullGeoCallback * @param {String} error Error message, if any. * @param {module:model/PersonalNameGenderedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely gender of a full name, given a local context (ISO2 country code). * @param {String} fullName * @param {String} countryIso2 * @param {module:api/PersonalApi~genderFullGeoCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/PersonalNameGenderedOut} */ this.genderFullGeo = function(fullName, countryIso2, callback) { var postBody = null; // verify the required parameter 'fullName' is set if (fullName === undefined || fullName === null) { throw new Error("Missing the required parameter 'fullName' when calling genderFullGeo"); } // verify the required parameter 'countryIso2' is set if (countryIso2 === undefined || countryIso2 === null) { throw new Error("Missing the required parameter 'countryIso2' when calling genderFullGeo"); } var pathParams = { 'fullName': fullName, 'countryIso2': countryIso2 }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; var returnType = PersonalNameGenderedOut; return this.apiClient.callApi( '/api2/json/genderFullGeo/{fullName}/{countryIso2}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the genderFullGeoBatch operation. * @callback module:api/PersonalApi~genderFullGeoBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchPersonalNameGenderedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely gender of up to 100 full names, with a given cultural context (country ISO2 code). * @param {Object} opts Optional parameters * @param {module:model/BatchPersonalNameGeoIn} opts.batchPersonalNameGeoIn A list of personal names, with a country ISO2 code * @param {module:api/PersonalApi~genderFullGeoBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchPersonalNameGenderedOut} */ this.genderFullGeoBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchPersonalNameGeoIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchPersonalNameGenderedOut; return this.apiClient.callApi( '/api2/json/genderFullGeoBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the genderGeo operation. * @callback module:api/PersonalApi~genderGeoCallback * @param {String} error Error message, if any. * @param {module:model/FirstLastNameGenderedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely gender of a name, given a local context (ISO2 country code). * @param {String} firstName * @param {String} lastName * @param {String} countryIso2 * @param {module:api/PersonalApi~genderGeoCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/FirstLastNameGenderedOut} */ this.genderGeo = function(firstName, lastName, countryIso2, callback) { var postBody = null; // verify the required parameter 'firstName' is set if (firstName === undefined || firstName === null) { throw new Error("Missing the required parameter 'firstName' when calling genderGeo"); } // verify the required parameter 'lastName' is set if (lastName === undefined || lastName === null) { throw new Error("Missing the required parameter 'lastName' when calling genderGeo"); } // verify the required parameter 'countryIso2' is set if (countryIso2 === undefined || countryIso2 === null) { throw new Error("Missing the required parameter 'countryIso2' when calling genderGeo"); } var pathParams = { 'firstName': firstName, 'lastName': lastName, 'countryIso2': countryIso2 }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; var returnType = FirstLastNameGenderedOut; return this.apiClient.callApi( '/api2/json/genderGeo/{firstName}/{lastName}/{countryIso2}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the genderGeoBatch operation. * @callback module:api/PersonalApi~genderGeoBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchFirstLastNameGenderedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely gender of up to 100 names, each given a local context (ISO2 country code). * @param {Object} opts Optional parameters * @param {module:model/BatchFirstLastNameGeoIn} opts.batchFirstLastNameGeoIn A list of names, with country code. * @param {module:api/PersonalApi~genderGeoBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchFirstLastNameGenderedOut} */ this.genderGeoBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchFirstLastNameGeoIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchFirstLastNameGenderedOut; return this.apiClient.callApi( '/api2/json/genderGeoBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the origin operation. * @callback module:api/PersonalApi~originCallback * @param {String} error Error message, if any. * @param {module:model/FirstLastNameOriginedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * [USES 10 UNITS PER NAME] Infer the likely country of origin of a personal name. Assumes names as they are in the country of origin. For US, CA, AU, NZ and other melting-pots : use 'diaspora' instead. * @param {String} firstName * @param {String} lastName * @param {module:api/PersonalApi~originCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/FirstLastNameOriginedOut} */ this.origin = function(firstName, lastName, callback) { var postBody = null; // verify the required parameter 'firstName' is set if (firstName === undefined || firstName === null) { throw new Error("Missing the required parameter 'firstName' when calling origin"); } // verify the required parameter 'lastName' is set if (lastName === undefined || lastName === null) { throw new Error("Missing the required parameter 'lastName' when calling origin"); } var pathParams = { 'firstName': firstName, 'lastName': lastName }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; var returnType = FirstLastNameOriginedOut; return this.apiClient.callApi( '/api2/json/origin/{firstName}/{lastName}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the originBatch operation. * @callback module:api/PersonalApi~originBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchFirstLastNameOriginedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * [USES 10 UNITS PER NAME] Infer the likely country of origin of up to 100 names, detecting automatically the cultural context. * @param {Object} opts Optional parameters * @param {module:model/BatchFirstLastNameIn} opts.batchFirstLastNameIn A list of personal names * @param {module:api/PersonalApi~originBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchFirstLastNameOriginedOut} */ this.originBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchFirstLastNameIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchFirstLastNameOriginedOut; return this.apiClient.callApi( '/api2/json/originBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the parseName operation. * @callback module:api/PersonalApi~parseNameCallback * @param {String} error Error message, if any. * @param {module:model/PersonalNameParsedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely first/last name structure of a name, ex. John Smith or SMITH, John or SMITH; John. * @param {String} nameFull * @param {module:api/PersonalApi~parseNameCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/PersonalNameParsedOut} */ this.parseName = function(nameFull, callback) { var postBody = null; // verify the required parameter 'nameFull' is set if (nameFull === undefined || nameFull === null) { throw new Error("Missing the required parameter 'nameFull' when calling parseName"); } var pathParams = { 'nameFull': nameFull }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; var returnType = PersonalNameParsedOut; return this.apiClient.callApi( '/api2/json/parseName/{nameFull}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the parseNameBatch operation. * @callback module:api/PersonalApi~parseNameBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchPersonalNameParsedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely first/last name structure of a name, ex. John Smith or SMITH, John or SMITH; John. * @param {Object} opts Optional parameters * @param {module:model/BatchPersonalNameIn} opts.batchPersonalNameIn A list of personal names * @param {module:api/PersonalApi~parseNameBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchPersonalNameParsedOut} */ this.parseNameBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchPersonalNameIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchPersonalNameParsedOut; return this.apiClient.callApi( '/api2/json/parseNameBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the parseNameGeo operation. * @callback module:api/PersonalApi~parseNameGeoCallback * @param {String} error Error message, if any. * @param {module:model/PersonalNameParsedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely first/last name structure of a name, ex. John Smith or SMITH, John or SMITH; John. For better accuracy, provide a geographic context. * @param {String} nameFull * @param {String} countryIso2 * @param {module:api/PersonalApi~parseNameGeoCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/PersonalNameParsedOut} */ this.parseNameGeo = function(nameFull, countryIso2, callback) { var postBody = null; // verify the required parameter 'nameFull' is set if (nameFull === undefined || nameFull === null) { throw new Error("Missing the required parameter 'nameFull' when calling parseNameGeo"); } // verify the required parameter 'countryIso2' is set if (countryIso2 === undefined || countryIso2 === null) { throw new Error("Missing the required parameter 'countryIso2' when calling parseNameGeo"); } var pathParams = { 'nameFull': nameFull, 'countryIso2': countryIso2 }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; var returnType = PersonalNameParsedOut; return this.apiClient.callApi( '/api2/json/parseName/{nameFull}/{countryIso2}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the parseNameGeoBatch operation. * @callback module:api/PersonalApi~parseNameGeoBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchPersonalNameParsedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely first/last name structure of a name, ex. John Smith or SMITH, John or SMITH; John. Giving a local context improves precision. * @param {Object} opts Optional parameters * @param {module:model/BatchPersonalNameGeoIn} opts.batchPersonalNameGeoIn A list of personal names * @param {module:api/PersonalApi~parseNameGeoBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchPersonalNameParsedOut} */ this.parseNameGeoBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchPersonalNameGeoIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchPersonalNameParsedOut; return this.apiClient.callApi( '/api2/json/parseNameGeoBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the parsedGenderBatch operation. * @callback module:api/PersonalApi~parsedGenderBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchFirstLastNameGenderedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely gender of up to 100 fully parsed names, detecting automatically the cultural context. * @param {Object} opts Optional parameters * @param {module:model/BatchParsedFullNameIn} opts.batchParsedFullNameIn A list of personal names * @param {module:api/PersonalApi~parsedGenderBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchFirstLastNameGenderedOut} */ this.parsedGenderBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchParsedFullNameIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchFirstLastNameGenderedOut; return this.apiClient.callApi( '/api2/json/parsedGenderBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the parsedGenderGeoBatch operation. * @callback module:api/PersonalApi~parsedGenderGeoBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchFirstLastNameGenderedOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * Infer the likely gender of up to 100 fully parsed names, detecting automatically the cultural context. * @param {Object} opts Optional parameters * @param {module:model/BatchParsedFullNameGeoIn} opts.batchParsedFullNameGeoIn A list of personal names * @param {module:api/PersonalApi~parsedGenderGeoBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchFirstLastNameGenderedOut} */ this.parsedGenderGeoBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchParsedFullNameGeoIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchFirstLastNameGenderedOut; return this.apiClient.callApi( '/api2/json/parsedGenderGeoBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the usRaceEthnicity operation. * @callback module:api/PersonalApi~usRaceEthnicityCallback * @param {String} error Error message, if any. * @param {module:model/FirstLastNameUSRaceEthnicityOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * [USES 10 UNITS PER NAME] Infer a US resident's likely race/ethnicity according to US Census taxonomy W_NL (white, non latino), HL (hispano latino), A (asian, non latino), B_NL (black, non latino). * @param {String} firstName * @param {String} lastName * @param {module:api/PersonalApi~usRaceEthnicityCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/FirstLastNameUSRaceEthnicityOut} */ this.usRaceEthnicity = function(firstName, lastName, callback) { var postBody = null; // verify the required parameter 'firstName' is set if (firstName === undefined || firstName === null) { throw new Error("Missing the required parameter 'firstName' when calling usRaceEthnicity"); } // verify the required parameter 'lastName' is set if (lastName === undefined || lastName === null) { throw new Error("Missing the required parameter 'lastName' when calling usRaceEthnicity"); } var pathParams = { 'firstName': firstName, 'lastName': lastName }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; var returnType = FirstLastNameUSRaceEthnicityOut; return this.apiClient.callApi( '/api2/json/usRaceEthnicity/{firstName}/{lastName}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the usRaceEthnicityBatch operation. * @callback module:api/PersonalApi~usRaceEthnicityBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchFirstLastNameUSRaceEthnicityOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * [USES 10 UNITS PER NAME] Infer up-to 100 US resident's likely race/ethnicity according to US Census taxonomy. * @param {Object} opts Optional parameters * @param {module:model/BatchFirstLastNameGeoIn} opts.batchFirstLastNameGeoIn A list of personal names * @param {module:api/PersonalApi~usRaceEthnicityBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchFirstLastNameUSRaceEthnicityOut} */ this.usRaceEthnicityBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchFirstLastNameGeoIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchFirstLastNameUSRaceEthnicityOut; return this.apiClient.callApi( '/api2/json/usRaceEthnicityBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the usRaceEthnicityZIP5 operation. * @callback module:api/PersonalApi~usRaceEthnicityZIP5Callback * @param {String} error Error message, if any. * @param {module:model/FirstLastNameUSRaceEthnicityOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * [USES 10 UNITS PER NAME] Infer a US resident's likely race/ethnicity according to US Census taxonomy, using (optional) ZIP5 code info. Output is W_NL (white, non latino), HL (hispano latino), A (asian, non latino), B_NL (black, non latino). * @param {String} firstName * @param {String} lastName * @param {String} zip5Code * @param {module:api/PersonalApi~usRaceEthnicityZIP5Callback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/FirstLastNameUSRaceEthnicityOut} */ this.usRaceEthnicityZIP5 = function(firstName, lastName, zip5Code, callback) { var postBody = null; // verify the required parameter 'firstName' is set if (firstName === undefined || firstName === null) { throw new Error("Missing the required parameter 'firstName' when calling usRaceEthnicityZIP5"); } // verify the required parameter 'lastName' is set if (lastName === undefined || lastName === null) { throw new Error("Missing the required parameter 'lastName' when calling usRaceEthnicityZIP5"); } // verify the required parameter 'zip5Code' is set if (zip5Code === undefined || zip5Code === null) { throw new Error("Missing the required parameter 'zip5Code' when calling usRaceEthnicityZIP5"); } var pathParams = { 'firstName': firstName, 'lastName': lastName, 'zip5Code': zip5Code }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = []; var accepts = ['application/json']; var returnType = FirstLastNameUSRaceEthnicityOut; return this.apiClient.callApi( '/api2/json/usRaceEthnicityZIP5/{firstName}/{lastName}/{zip5Code}', 'GET', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } /** * Callback function to receive the result of the usZipRaceEthnicityBatch operation. * @callback module:api/PersonalApi~usZipRaceEthnicityBatchCallback * @param {String} error Error message, if any. * @param {module:model/BatchFirstLastNameUSRaceEthnicityOut} data The data returned by the service call. * @param {String} response The complete HTTP response. */ /** * [USES 10 UNITS PER NAME] Infer up-to 100 US resident's likely race/ethnicity according to US Census taxonomy, with (optional) ZIP code. * @param {Object} opts Optional parameters * @param {module:model/BatchFirstLastNameGeoZippedIn} opts.batchFirstLastNameGeoZippedIn A list of personal names * @param {module:api/PersonalApi~usZipRaceEthnicityBatchCallback} callback The callback function, accepting three arguments: error, data, response * data is of type: {@link module:model/BatchFirstLastNameUSRaceEthnicityOut} */ this.usZipRaceEthnicityBatch = function(opts, callback) { opts = opts || {}; var postBody = opts['batchFirstLastNameGeoZippedIn']; var pathParams = { }; var queryParams = { }; var collectionQueryParams = { }; var headerParams = { }; var formParams = { }; var authNames = ['api_key']; var contentTypes = ['application/json']; var accepts = ['application/json']; var returnType = BatchFirstLastNameUSRaceEthnicityOut; return this.apiClient.callApi( '/api2/json/usZipRaceEthnicityBatch', 'POST', pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, callback ); } }; return exports; }));