@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,452 lines (1,239 loc) • 66.3 kB
JavaScript
/**
* 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/APIKeyOut', 'model/APIPeriodUsageOut', 'model/APIPlanSubscriptionOut', 'model/APIPlansOut', 'model/BillingHistoryOut', 'model/BillingInfoInOut', 'model/CurrenciesOut', 'model/InlineObject', 'model/SoftwareVersionOut', 'model/SystemMetricsOut'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/APIKeyOut'), require('../model/APIPeriodUsageOut'), require('../model/APIPlanSubscriptionOut'), require('../model/APIPlansOut'), require('../model/BillingHistoryOut'), require('../model/BillingInfoInOut'), require('../model/CurrenciesOut'), require('../model/InlineObject'), require('../model/SoftwareVersionOut'), require('../model/SystemMetricsOut'));
} else {
// Browser globals (root is window)
if (!root.NamSorApiV2) {
root.NamSorApiV2 = {};
}
root.NamSorApiV2.AdminApi = factory(root.NamSorApiV2.ApiClient, root.NamSorApiV2.APIKeyOut, root.NamSorApiV2.APIPeriodUsageOut, root.NamSorApiV2.APIPlanSubscriptionOut, root.NamSorApiV2.APIPlansOut, root.NamSorApiV2.BillingHistoryOut, root.NamSorApiV2.BillingInfoInOut, root.NamSorApiV2.CurrenciesOut, root.NamSorApiV2.InlineObject, root.NamSorApiV2.SoftwareVersionOut, root.NamSorApiV2.SystemMetricsOut);
}
}(this, function(ApiClient, APIKeyOut, APIPeriodUsageOut, APIPlanSubscriptionOut, APIPlansOut, BillingHistoryOut, BillingInfoInOut, CurrenciesOut, InlineObject, SoftwareVersionOut, SystemMetricsOut) {
'use strict';
/**
* Admin service.
* @module api/AdminApi
* @version 2.0.11
*/
/**
* Constructs a new AdminApi.
* @alias module:api/AdminApi
* @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 addCredits operation.
* @callback module:api/AdminApi~addCreditsCallback
* @param {String} error Error message, if any.
* @param {module:model/SystemMetricsOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Add usage credits to an API Key.
* @param {String} apiKey
* @param {Number} usageCredits
* @param {String} userMessage
* @param {module:api/AdminApi~addCreditsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/SystemMetricsOut}
*/
this.addCredits = function(apiKey, usageCredits, userMessage, callback) {
var postBody = null;
// verify the required parameter 'apiKey' is set
if (apiKey === undefined || apiKey === null) {
throw new Error("Missing the required parameter 'apiKey' when calling addCredits");
}
// verify the required parameter 'usageCredits' is set
if (usageCredits === undefined || usageCredits === null) {
throw new Error("Missing the required parameter 'usageCredits' when calling addCredits");
}
// verify the required parameter 'userMessage' is set
if (userMessage === undefined || userMessage === null) {
throw new Error("Missing the required parameter 'userMessage' when calling addCredits");
}
var pathParams = {
'apiKey': apiKey,
'usageCredits': usageCredits,
'userMessage': userMessage
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = SystemMetricsOut;
return this.apiClient.callApi(
'/api2/json/addCredits/{apiKey}/{usageCredits}/{userMessage}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the anonymize operation.
* @callback module:api/AdminApi~anonymizeCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Activate/deactivate anonymization for a source.
* @param {String} source
* @param {Boolean} anonymized
* @param {module:api/AdminApi~anonymizeCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.anonymize = function(source, anonymized, callback) {
var postBody = null;
// verify the required parameter 'source' is set
if (source === undefined || source === null) {
throw new Error("Missing the required parameter 'source' when calling anonymize");
}
// verify the required parameter 'anonymized' is set
if (anonymized === undefined || anonymized === null) {
throw new Error("Missing the required parameter 'anonymized' when calling anonymize");
}
var pathParams = {
'source': source,
'anonymized': anonymized
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/api2/json/anonymize/{source}/{anonymized}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the apiStatus operation.
* @callback module:api/AdminApi~apiStatusCallback
* @param {String} error Error message, if any.
* @param {module:model/APIPlansOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Prints the current status of the classifiers.
* @param {module:api/AdminApi~apiStatusCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIPlansOut}
*/
this.apiStatus = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIPlansOut;
return this.apiClient.callApi(
'/api2/json/apiStatus', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the apiUsage operation.
* @callback module:api/AdminApi~apiUsageCallback
* @param {String} error Error message, if any.
* @param {module:model/APIPeriodUsageOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Print current API usage.
* @param {module:api/AdminApi~apiUsageCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIPeriodUsageOut}
*/
this.apiUsage = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIPeriodUsageOut;
return this.apiClient.callApi(
'/api2/json/apiUsage', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the apiUsageHistory operation.
* @callback module:api/AdminApi~apiUsageHistoryCallback
* @param {String} error Error message, if any.
* @param {module:model/APIPeriodUsageOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Print historical API usage.
* @param {module:api/AdminApi~apiUsageHistoryCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIPeriodUsageOut}
*/
this.apiUsageHistory = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIPeriodUsageOut;
return this.apiClient.callApi(
'/api2/json/apiUsageHistory', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the apiUsageHistoryAggregate operation.
* @callback module:api/AdminApi~apiUsageHistoryAggregateCallback
* @param {String} error Error message, if any.
* @param {module:model/APIPeriodUsageOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Print historical API usage (in an aggregated view, by service, by day/hour/min).
* @param {module:api/AdminApi~apiUsageHistoryAggregateCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIPeriodUsageOut}
*/
this.apiUsageHistoryAggregate = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIPeriodUsageOut;
return this.apiClient.callApi(
'/api2/json/apiUsageHistoryAggregate', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the availablePlans operation.
* @callback module:api/AdminApi~availablePlansCallback
* @param {String} error Error message, if any.
* @param {module:model/APIPlansOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* List all available plans in the user's preferred currency.
* @param {String} token
* @param {module:api/AdminApi~availablePlansCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIPlansOut}
*/
this.availablePlans = function(token, callback) {
var postBody = null;
// verify the required parameter 'token' is set
if (token === undefined || token === null) {
throw new Error("Missing the required parameter 'token' when calling availablePlans");
}
var pathParams = {
'token': token
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIPlansOut;
return this.apiClient.callApi(
'/api2/json/availablePlans/{token}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the availablePlans1 operation.
* @callback module:api/AdminApi~availablePlans1Callback
* @param {String} error Error message, if any.
* @param {module:model/APIPlansOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* List all available plans in the default currency (usd).
* @param {module:api/AdminApi~availablePlans1Callback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIPlansOut}
*/
this.availablePlans1 = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIPlansOut;
return this.apiClient.callApi(
'/api2/json/availablePlans', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the availableServices operation.
* @callback module:api/AdminApi~availableServicesCallback
* @param {String} error Error message, if any.
* @param {module:model/APIPlansOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* List of API services and usage cost in Units (default is 1=ONE Unit).
* @param {module:api/AdminApi~availableServicesCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIPlansOut}
*/
this.availableServices = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIPlansOut;
return this.apiClient.callApi(
'/api2/json/apiServices', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the billingCurrencies operation.
* @callback module:api/AdminApi~billingCurrenciesCallback
* @param {String} error Error message, if any.
* @param {module:model/CurrenciesOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* List possible currency options for billing (USD, EUR, GBP, ...)
* @param {module:api/AdminApi~billingCurrenciesCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/CurrenciesOut}
*/
this.billingCurrencies = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = CurrenciesOut;
return this.apiClient.callApi(
'/api2/json/billingCurrencies', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the billingHistory operation.
* @callback module:api/AdminApi~billingHistoryCallback
* @param {String} error Error message, if any.
* @param {module:model/BillingHistoryOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Read the history billing information (invoices paid via Stripe or manually).
* @param {String} token
* @param {module:api/AdminApi~billingHistoryCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/BillingHistoryOut}
*/
this.billingHistory = function(token, callback) {
var postBody = null;
// verify the required parameter 'token' is set
if (token === undefined || token === null) {
throw new Error("Missing the required parameter 'token' when calling billingHistory");
}
var pathParams = {
'token': token
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = BillingHistoryOut;
return this.apiClient.callApi(
'/api2/json/billingHistory/{token}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the billingInfo operation.
* @callback module:api/AdminApi~billingInfoCallback
* @param {String} error Error message, if any.
* @param {module:model/BillingInfoInOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Read the billing information (company name, address, phone, vat ID)
* @param {String} token
* @param {module:api/AdminApi~billingInfoCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/BillingInfoInOut}
*/
this.billingInfo = function(token, callback) {
var postBody = null;
// verify the required parameter 'token' is set
if (token === undefined || token === null) {
throw new Error("Missing the required parameter 'token' when calling billingInfo");
}
var pathParams = {
'token': token
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = BillingInfoInOut;
return this.apiClient.callApi(
'/api2/json/billingInfo/{token}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the charge operation.
* @callback module:api/AdminApi~chargeCallback
* @param {String} error Error message, if any.
* @param {module:model/APIKeyOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Create a Stripe Customer, based on a payment card token (from secure StripeJS) and email.
* @param {Object} opts Optional parameters
* @param {module:model/InlineObject} opts.inlineObject
* @param {module:api/AdminApi~chargeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIKeyOut}
*/
this.charge = function(opts, callback) {
opts = opts || {};
var postBody = opts['inlineObject'];
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIKeyOut;
return this.apiClient.callApi(
'/api2/json/charge', 'POST',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the corporateKey operation.
* @callback module:api/AdminApi~corporateKeyCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Setting an API Key to a corporate status.
* @param {String} apiKey
* @param {Boolean} corporate
* @param {module:api/AdminApi~corporateKeyCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.corporateKey = function(apiKey, corporate, callback) {
var postBody = null;
// verify the required parameter 'apiKey' is set
if (apiKey === undefined || apiKey === null) {
throw new Error("Missing the required parameter 'apiKey' when calling corporateKey");
}
// verify the required parameter 'corporate' is set
if (corporate === undefined || corporate === null) {
throw new Error("Missing the required parameter 'corporate' when calling corporateKey");
}
var pathParams = {
'apiKey': apiKey,
'corporate': corporate
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/api2/json/corporateKey/{apiKey}/{corporate}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the debugLevel operation.
* @callback module:api/AdminApi~debugLevelCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Update debug level for a classifier
* @param {String} logger
* @param {String} level
* @param {module:api/AdminApi~debugLevelCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.debugLevel = function(logger, level, callback) {
var postBody = null;
// verify the required parameter 'logger' is set
if (logger === undefined || logger === null) {
throw new Error("Missing the required parameter 'logger' when calling debugLevel");
}
// verify the required parameter 'level' is set
if (level === undefined || level === null) {
throw new Error("Missing the required parameter 'level' when calling debugLevel");
}
var pathParams = {
'logger': logger,
'level': level
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/api2/json/debugLevel/{logger}/{level}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the flush operation.
* @callback module:api/AdminApi~flushCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Flush counters.
* @param {module:api/AdminApi~flushCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.flush = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/api2/json/flush', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the invalidateCache operation.
* @callback module:api/AdminApi~invalidateCacheCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Invalidate system caches.
* @param {module:api/AdminApi~invalidateCacheCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.invalidateCache = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/api2/json/invalidateCache', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the learnable operation.
* @callback module:api/AdminApi~learnableCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Activate/deactivate learning from a source.
* @param {String} source
* @param {Boolean} learnable
* @param {module:api/AdminApi~learnableCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.learnable = function(source, learnable, callback) {
var postBody = null;
// verify the required parameter 'source' is set
if (source === undefined || source === null) {
throw new Error("Missing the required parameter 'source' when calling learnable");
}
// verify the required parameter 'learnable' is set
if (learnable === undefined || learnable === null) {
throw new Error("Missing the required parameter 'learnable' when calling learnable");
}
var pathParams = {
'source': source,
'learnable': learnable
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/api2/json/learnable/{source}/{learnable}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the namsorCounter operation.
* @callback module:api/AdminApi~namsorCounterCallback
* @param {String} error Error message, if any.
* @param {module:model/SoftwareVersionOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get the overall API counter
* @param {module:api/AdminApi~namsorCounterCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/SoftwareVersionOut}
*/
this.namsorCounter = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = SoftwareVersionOut;
return this.apiClient.callApi(
'/api2/json/namsorCounter', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the paymentInfo operation.
* @callback module:api/AdminApi~paymentInfoCallback
* @param {String} error Error message, if any.
* @param {module:model/APIKeyOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get the Stripe payment information associated with the current google auth session token.
* @param {String} token
* @param {module:api/AdminApi~paymentInfoCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIKeyOut}
*/
this.paymentInfo = function(token, callback) {
var postBody = null;
// verify the required parameter 'token' is set
if (token === undefined || token === null) {
throw new Error("Missing the required parameter 'token' when calling paymentInfo");
}
var pathParams = {
'token': token
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIKeyOut;
return this.apiClient.callApi(
'/api2/json/paymentInfo/{token}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the procureKey operation.
* @callback module:api/AdminApi~procureKeyCallback
* @param {String} error Error message, if any.
* @param {module:model/APIKeyOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Procure an API Key (sent via Email), based on an auth token. Keep your API Key secret.
* @param {String} token
* @param {module:api/AdminApi~procureKeyCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIKeyOut}
*/
this.procureKey = function(token, callback) {
var postBody = null;
// verify the required parameter 'token' is set
if (token === undefined || token === null) {
throw new Error("Missing the required parameter 'token' when calling procureKey");
}
var pathParams = {
'token': token
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIKeyOut;
return this.apiClient.callApi(
'/api2/json/procureKey/{token}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the redeployUI operation.
* @callback module:api/AdminApi~redeployUICallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Redeploy UI from current dev branch.
* @param {Boolean} live
* @param {module:api/AdminApi~redeployUICallback} callback The callback function, accepting three arguments: error, data, response
*/
this.redeployUI = function(live, callback) {
var postBody = null;
// verify the required parameter 'live' is set
if (live === undefined || live === null) {
throw new Error("Missing the required parameter 'live' when calling redeployUI");
}
var pathParams = {
'live': live
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/api2/json/redeployUI/{live}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the redeployUI1 operation.
* @callback module:api/AdminApi~redeployUI1Callback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Redeploy UI from current dev branch.
* @param {module:api/AdminApi~redeployUI1Callback} callback The callback function, accepting three arguments: error, data, response
*/
this.redeployUI1 = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/api2/json/redeployUI', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the removeUserAccount operation.
* @callback module:api/AdminApi~removeUserAccountCallback
* @param {String} error Error message, if any.
* @param {module:model/APIPlanSubscriptionOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Remove the user account.
* @param {String} token
* @param {module:api/AdminApi~removeUserAccountCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIPlanSubscriptionOut}
*/
this.removeUserAccount = function(token, callback) {
var postBody = null;
// verify the required parameter 'token' is set
if (token === undefined || token === null) {
throw new Error("Missing the required parameter 'token' when calling removeUserAccount");
}
var pathParams = {
'token': token
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIPlanSubscriptionOut;
return this.apiClient.callApi(
'/api2/json/removeUserAccount/{token}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the removeUserAccountOnBehalf operation.
* @callback module:api/AdminApi~removeUserAccountOnBehalfCallback
* @param {String} error Error message, if any.
* @param {module:model/APIPlanSubscriptionOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Remove (on behalf) a user account.
* @param {String} apiKey
* @param {module:api/AdminApi~removeUserAccountOnBehalfCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIPlanSubscriptionOut}
*/
this.removeUserAccountOnBehalf = function(apiKey, callback) {
var postBody = null;
// verify the required parameter 'apiKey' is set
if (apiKey === undefined || apiKey === null) {
throw new Error("Missing the required parameter 'apiKey' when calling removeUserAccountOnBehalf");
}
var pathParams = {
'apiKey': apiKey
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIPlanSubscriptionOut;
return this.apiClient.callApi(
'/api2/json/removeUserAccountOnBehalf/{apiKey}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the shutdown operation.
* @callback module:api/AdminApi~shutdownCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Stop learning and shutdown system.
* @param {module:api/AdminApi~shutdownCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.shutdown = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/api2/json/shutdown', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the softwareVersion operation.
* @callback module:api/AdminApi~softwareVersionCallback
* @param {String} error Error message, if any.
* @param {module:model/SoftwareVersionOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get the current software version
* @param {module:api/AdminApi~softwareVersionCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/SoftwareVersionOut}
*/
this.softwareVersion = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = SoftwareVersionOut;
return this.apiClient.callApi(
'/api2/json/softwareVersion', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the sourceStats operation.
* @callback module:api/AdminApi~sourceStatsCallback
* @param {String} error Error message, if any.
* @param {module:model/SystemMetricsOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Print basic source statistics.
* @param {String} source
* @param {module:api/AdminApi~sourceStatsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/SystemMetricsOut}
*/
this.sourceStats = function(source, callback) {
var postBody = null;
// verify the required parameter 'source' is set
if (source === undefined || source === null) {
throw new Error("Missing the required parameter 'source' when calling sourceStats");
}
var pathParams = {
'source': source
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = SystemMetricsOut;
return this.apiClient.callApi(
'/api2/json/sourceStats/{source}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the stats operation.
* @callback module:api/AdminApi~statsCallback
* @param {String} error Error message, if any.
* @param {module:model/SystemMetricsOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Print basic system statistics.
* @param {module:api/AdminApi~statsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/SystemMetricsOut}
*/
this.stats = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = SystemMetricsOut;
return this.apiClient.callApi(
'/api2/json/stats', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the stripeConnect operation.
* @callback module:api/AdminApi~stripeConnectCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Connects a Stripe Account.
* @param {Object} opts Optional parameters
* @param {String} opts.scope
* @param {String} opts.code
* @param {String} opts.error
* @param {String} opts.errorDescription
* @param {module:api/AdminApi~stripeConnectCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.stripeConnect = function(opts, callback) {
opts = opts || {};
var postBody = null;
var pathParams = {
};
var queryParams = {
'scope': opts['scope'],
'code': opts['code'],
'error': opts['error'],
'error_description': opts['errorDescription'],
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = [];
var returnType = null;
return this.apiClient.callApi(
'/api2/json/stripeConnect', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the subscribePlan operation.
* @callback module:api/AdminApi~subscribePlanCallback
* @param {String} error Error message, if any.
* @param {module:model/APIPlanSubscriptionOut} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Subscribe to a give API plan, using the user's preferred or default currency.
* @param {String} planName
* @param {String} token
* @param {module:api/AdminApi~subscribePlanCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/APIPlanSubscriptionOut}
*/
this.subscribePlan = function(planName, token, callback) {
var postBody = null;
// verify the required parameter 'planName' is set
if (planName === undefined || planName === null) {
throw new Error("Missing the required parameter 'planName' when calling subscribePlan");
}
// verify the required parameter 'token' is set
if (token === undefined || token === null) {
throw new Error("Missing the required parameter 'token' when calling subscribePlan");
}
var pathParams = {
'planName': planName,
'token': token
};
var queryParams = {
};
var collectionQueryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = APIPlanSubscriptionOut;
return this.apiClient.callApi(
'/api2/json/subscribePlan/{planName}/{token}', 'GET',
pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the subscribePlanOnBehalf operation.
* @callback module:api/AdminApi~subscribePlanOnBehalfCallback
* @param {String} error Error message, if any.
* @param {module:model/APIPlanSubscriptionOut} data The data returned