Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
NamSor SAS committed Jun 7, 2020
1 parent 76555c1 commit e82a853
Show file tree
Hide file tree
Showing 548 changed files with 6,477 additions and 2,318 deletions.
96 changes: 34 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# namsor-sdk2

NamSor API v2
- API version: 2.0.9
- Build date: 2020-03-15T12:23:01.598+01:00[Europe/Berlin]
- API version: 2.0.10
- Build date: 2020-06-07T20:31:24.687+02:00[Europe/Berlin]

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!

Expand Down Expand Up @@ -41,7 +41,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.namsor</groupId>
<artifactId>namsor-sdk2</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -51,7 +51,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
compile "com.namsor:namsor-sdk2:2.0.9"
compile "com.namsor:namsor-sdk2:2.0.10"
```

### Others
Expand All @@ -64,89 +64,48 @@ mvn clean package

Then manually install the following JARs:

* `target/namsor-sdk2-2.0.9.jar`
* `target/namsor-sdk2-2.0.10.jar`
* `target/lib/*.jar`

## Getting Started

Please follow the [installation](#installation) instruction and execute the following Java code:

```java
package com.namsor.namsorsample;

import com.namsor.sdk2.invoke.*;
import com.namsor.sdk2.invoke.auth.*;
import com.namsor.sdk2.model.*;
import com.namsor.sdk2.api.PersonalApi;
import com.namsor.sdk2.api.AdminApi;

import java.io.File;
import java.util.*;

public class PersonalApiSample {
public class AdminApiExample {

public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");

PersonalApi apiInstance = new PersonalApi();

// should contain 10 to 100 names at a time, per API call
BatchFirstLastNameIn batchFirstLastNameIn = new BatchFirstLastNameIn(); // BatchFirstLastNameIn | A list of personal names
batchFirstLastNameIn.setPersonalNames(new ArrayList());
FirstLastNameIn name1 = new FirstLastNameIn();
name1.setId("123");
name1.setFirstName("Mary");
name1.setLastName("O'Neil");
batchFirstLastNameIn.getPersonalNames().add(name1);
FirstLastNameIn name2 = new FirstLastNameIn();
name2.setId("234");
name2.setFirstName("Roberto");
name2.setLastName("Rossini");
batchFirstLastNameIn.getPersonalNames().add(name2);
AdminApi apiInstance = new AdminApi();
String apiKey = "apiKey_example"; // String |
Long usageCredits = 56L; // Long |
String userMessage = "userMessage_example"; // String |
try {
BatchFirstLastNameOriginedOut result = apiInstance.originBatch(batchFirstLastNameIn);
SystemMetricsOut result = apiInstance.addCredits(apiKey, usageCredits, userMessage);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PersonalApi#originBatch");
System.err.println("Exception when calling AdminApi#addCredits");
e.printStackTrace();
}
}
}

```
This will output the following :
```javascript
class BatchFirstLastNameOriginedOut {
personalNames: [class FirstLastNameOriginedOut {
id: 123
firstName: Mary
lastName: O'Neil
countryOrigin: IE
countryOriginAlt: GB
countriesOriginTop: [IE, GB, KE, GH, LR, FR, TZ, NG, IL, EG]
score: 26.729154354675913
regionOrigin: Europe
topRegionOrigin: Europe
subRegionOrigin: Northern Europe
probabilityCalibrated: 0.9303604468868103
probabilityAltCalibrated: 0.9930598411485871
}, class FirstLastNameOriginedOut {
id: 123
firstName: Roberto
lastName: Rossini
countryOrigin: IT
countryOriginAlt: ES
countriesOriginTop: [IT, ES, CH, ID, PT, ZA, IL, AT, FI, FR]
score: 36.490714227516584
regionOrigin: Europe
topRegionOrigin: Europe
subRegionOrigin: Southern Europe
probabilityCalibrated: 0.9824811693994274
probabilityAltCalibrated: 0.9930598411485871
}]
}
```

## Documentation for API Endpoints
Expand All @@ -161,8 +120,8 @@ Class | Method | HTTP request | Description
*AdminApi* | [**apiUsage**](docs/AdminApi.md#apiUsage) | **GET** /api2/json/apiUsage | Print current API usage.
*AdminApi* | [**apiUsageHistory**](docs/AdminApi.md#apiUsageHistory) | **GET** /api2/json/apiUsageHistory | Print historical API usage.
*AdminApi* | [**apiUsageHistoryAggregate**](docs/AdminApi.md#apiUsageHistoryAggregate) | **GET** /api2/json/apiUsageHistoryAggregate | Print historical API usage (in an aggregated view, by service, by day/hour/min).
*AdminApi* | [**availablePlans**](docs/AdminApi.md#availablePlans) | **GET** /api2/json/availablePlans/{token} | List all available plans in the user&#39;s preferred currency.
*AdminApi* | [**availablePlans1**](docs/AdminApi.md#availablePlans1) | **GET** /api2/json/availablePlans | List all available plans in the default currency (usd).
*AdminApi* | [**availablePlans**](docs/AdminApi.md#availablePlans) | **GET** /api2/json/availablePlans | List all available plans in the default currency (usd).
*AdminApi* | [**availablePlans1**](docs/AdminApi.md#availablePlans1) | **GET** /api2/json/availablePlans/{token} | List all available plans in the user&#39;s preferred currency.
*AdminApi* | [**availableServices**](docs/AdminApi.md#availableServices) | **GET** /api2/json/apiServices | List of API services and usage cost in Units (default is 1&#x3D;ONE Unit).
*AdminApi* | [**billingCurrencies**](docs/AdminApi.md#billingCurrencies) | **GET** /api2/json/billingCurrencies | List possible currency options for billing (USD, EUR, GBP, ...)
*AdminApi* | [**billingHistory**](docs/AdminApi.md#billingHistory) | **GET** /api2/json/billingHistory/{token} | Read the history billing information (invoices paid via Stripe or manually).
Expand All @@ -176,8 +135,8 @@ Class | Method | HTTP request | Description
*AdminApi* | [**namsorCounter**](docs/AdminApi.md#namsorCounter) | **GET** /api2/json/namsorCounter | Get the overall API counter
*AdminApi* | [**paymentInfo**](docs/AdminApi.md#paymentInfo) | **GET** /api2/json/paymentInfo/{token} | Get the Stripe payment information associated with the current google auth session token.
*AdminApi* | [**procureKey**](docs/AdminApi.md#procureKey) | **GET** /api2/json/procureKey/{token} | Procure an API Key (sent via Email), based on an auth token. Keep your API Key secret.
*AdminApi* | [**redeployUI**](docs/AdminApi.md#redeployUI) | **GET** /api2/json/redeployUI/{live} | Redeploy UI from current dev branch.
*AdminApi* | [**redeployUI1**](docs/AdminApi.md#redeployUI1) | **GET** /api2/json/redeployUI | Redeploy UI from current dev branch.
*AdminApi* | [**redeployUI**](docs/AdminApi.md#redeployUI) | **GET** /api2/json/redeployUI | Redeploy UI from current dev branch.
*AdminApi* | [**redeployUI1**](docs/AdminApi.md#redeployUI1) | **GET** /api2/json/redeployUI/{live} | Redeploy UI from current dev branch.
*AdminApi* | [**removeUserAccount**](docs/AdminApi.md#removeUserAccount) | **GET** /api2/json/removeUserAccount/{token} | Remove the user account.
*AdminApi* | [**removeUserAccountOnBehalf**](docs/AdminApi.md#removeUserAccountOnBehalf) | **GET** /api2/json/removeUserAccountOnBehalf/{apiKey} | Remove (on behalf) a user account.
*AdminApi* | [**shutdown**](docs/AdminApi.md#shutdown) | **GET** /api2/json/shutdown | Stop learning and shutdown system.
Expand Down Expand Up @@ -209,6 +168,19 @@ Class | Method | HTTP request | Description
*ChineseApi* | [**parseChineseNameBatch**](docs/ChineseApi.md#parseChineseNameBatch) | **POST** /api2/json/parseChineseNameBatch | Infer the likely first/last name structure of a name, ex. 王晓明 -&gt; 王(surname) 晓明(given name).
*ChineseApi* | [**pinyinChineseName**](docs/ChineseApi.md#pinyinChineseName) | **GET** /api2/json/pinyinChineseName/{chineseName} | Romanize the Chinese name to Pinyin, ex. 王晓明 -&gt; Wang (surname) Xiaoming (given name)
*ChineseApi* | [**pinyinChineseNameBatch**](docs/ChineseApi.md#pinyinChineseNameBatch) | **POST** /api2/json/pinyinChineseNameBatch | Romanize a list of Chinese name to Pinyin, ex. 王晓明 -&gt; Wang (surname) Xiaoming (given name).
*JapaneseApi* | [**genderJapaneseNameFull**](docs/JapaneseApi.md#genderJapaneseNameFull) | **GET** /api2/json/genderJapaneseNameFull/{japaneseName} | Infer the likely gender of a Japanese full name ex. 王晓明
*JapaneseApi* | [**genderJapaneseNameFullBatch**](docs/JapaneseApi.md#genderJapaneseNameFullBatch) | **POST** /api2/json/genderJapaneseNameFullBatch | Infer the likely gender of up to 100 full names
*JapaneseApi* | [**genderJapaneseNamePinyin**](docs/JapaneseApi.md#genderJapaneseNamePinyin) | **GET** /api2/json/genderJapaneseName/{japaneseSurname}/{japaneseGivenName} | Infer the likely gender of a Japanese name in LATIN (Pinyin).
*JapaneseApi* | [**genderJapaneseNamePinyinBatch**](docs/JapaneseApi.md#genderJapaneseNamePinyinBatch) | **POST** /api2/json/genderJapaneseNameBatch | Infer the likely gender of up to 100 Japanese names in LATIN (Pinyin).
*JapaneseApi* | [**japaneseNameKanjiCandidates**](docs/JapaneseApi.md#japaneseNameKanjiCandidates) | **GET** /api2/json/japaneseNameKanjiCandidates/{japaneseSurnameLatin}/{japaneseGivenNameLatin} | Identify japanese name candidates in KANJI, based on the romanized name ex. Yamamoto Sanae
*JapaneseApi* | [**japaneseNameKanjiCandidatesBatch**](docs/JapaneseApi.md#japaneseNameKanjiCandidatesBatch) | **POST** /api2/json/japaneseNameKanjiCandidatesBatch | Identify japanese name candidates in KANJI, based on the romanized name (firstName &#x3D; japaneseGivenName; lastName&#x3D;japaneseSurname), ex. Yamamoto Sanae
*JapaneseApi* | [**japaneseNameLatinCandidates**](docs/JapaneseApi.md#japaneseNameLatinCandidates) | **GET** /api2/json/japaneseNameLatinCandidates/{japaneseSurnameKanji}/{japaneseGivenNameKanji} | Romanize japanese name, based on the name in Kanji.
*JapaneseApi* | [**japaneseNameLatinCandidatesBatch**](docs/JapaneseApi.md#japaneseNameLatinCandidatesBatch) | **POST** /api2/json/japaneseNameLatinCandidatesBatch | Romanize japanese names, based on the name in KANJI
*JapaneseApi* | [**japaneseNameMatch**](docs/JapaneseApi.md#japaneseNameMatch) | **GET** /api2/json/japaneseNameMatch/{japaneseSurnameLatin}/{japaneseGivenNameLatin}/{japaneseName} | Return a score for matching Japanese name in KANJI ex. 山本 早苗 with a romanized name ex. Yamamoto Sanae
*JapaneseApi* | [**japaneseNameMatchBatch**](docs/JapaneseApi.md#japaneseNameMatchBatch) | **POST** /api2/json/japaneseNameMatchBatch | Return a score for matching a list of Japanese names in KANJI ex. 山本 早苗 with romanized names ex. Yamamoto Sanae
*JapaneseApi* | [**japaneseNameMatchFeedbackLoop**](docs/JapaneseApi.md#japaneseNameMatchFeedbackLoop) | **GET** /api2/json/japaneseNameMatchFeedbackLoop/{japaneseSurnameLatin}/{japaneseGivenNameLatin}/{japaneseName} | [CREDITS 1 UNIT] Feedback loop to better perform matching Japanese name in KANJI ex. 山本 早苗 with a romanized name ex. Yamamoto Sanae
*JapaneseApi* | [**parseJapaneseName**](docs/JapaneseApi.md#parseJapaneseName) | **GET** /api2/json/parseJapaneseName/{japaneseName} | Infer the likely first/last name structure of a name, ex. 山本 早苗 or Yamamoto Sanae
*JapaneseApi* | [**parseJapaneseNameBatch**](docs/JapaneseApi.md#parseJapaneseNameBatch) | **POST** /api2/json/parseJapaneseNameBatch | Infer the likely first/last name structure of a name, ex. 山本 早苗 or Yamamoto Sanae
*PersonalApi* | [**country**](docs/PersonalApi.md#country) | **GET** /api2/json/country/{personalNameFull} | [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.
*PersonalApi* | [**countryBatch**](docs/PersonalApi.md#countryBatch) | **POST** /api2/json/countryBatch | [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.
*PersonalApi* | [**diaspora**](docs/PersonalApi.md#diaspora) | **GET** /api2/json/diaspora/{countryIso2}/{firstName}/{lastName} | [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.)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'idea'
apply plugin: 'eclipse'

group = 'com.namsor'
version = '2.0.9'
version = '2.0.10'

buildscript {
repositories {
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
settings(
organization := "com.namsor",
name := "namsor-sdk2",
version := "2.0.9",
version := "2.0.10",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
Expand Down
52 changes: 26 additions & 26 deletions docs/AdminApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Method | HTTP request | Description
[**apiUsage**](AdminApi.md#apiUsage) | **GET** /api2/json/apiUsage | Print current API usage.
[**apiUsageHistory**](AdminApi.md#apiUsageHistory) | **GET** /api2/json/apiUsageHistory | Print historical API usage.
[**apiUsageHistoryAggregate**](AdminApi.md#apiUsageHistoryAggregate) | **GET** /api2/json/apiUsageHistoryAggregate | Print historical API usage (in an aggregated view, by service, by day/hour/min).
[**availablePlans**](AdminApi.md#availablePlans) | **GET** /api2/json/availablePlans/{token} | List all available plans in the user&#39;s preferred currency.
[**availablePlans1**](AdminApi.md#availablePlans1) | **GET** /api2/json/availablePlans | List all available plans in the default currency (usd).
[**availablePlans**](AdminApi.md#availablePlans) | **GET** /api2/json/availablePlans | List all available plans in the default currency (usd).
[**availablePlans1**](AdminApi.md#availablePlans1) | **GET** /api2/json/availablePlans/{token} | List all available plans in the user&#39;s preferred currency.
[**availableServices**](AdminApi.md#availableServices) | **GET** /api2/json/apiServices | List of API services and usage cost in Units (default is 1&#x3D;ONE Unit).
[**billingCurrencies**](AdminApi.md#billingCurrencies) | **GET** /api2/json/billingCurrencies | List possible currency options for billing (USD, EUR, GBP, ...)
[**billingHistory**](AdminApi.md#billingHistory) | **GET** /api2/json/billingHistory/{token} | Read the history billing information (invoices paid via Stripe or manually).
Expand All @@ -25,8 +25,8 @@ Method | HTTP request | Description
[**namsorCounter**](AdminApi.md#namsorCounter) | **GET** /api2/json/namsorCounter | Get the overall API counter
[**paymentInfo**](AdminApi.md#paymentInfo) | **GET** /api2/json/paymentInfo/{token} | Get the Stripe payment information associated with the current google auth session token.
[**procureKey**](AdminApi.md#procureKey) | **GET** /api2/json/procureKey/{token} | Procure an API Key (sent via Email), based on an auth token. Keep your API Key secret.
[**redeployUI**](AdminApi.md#redeployUI) | **GET** /api2/json/redeployUI/{live} | Redeploy UI from current dev branch.
[**redeployUI1**](AdminApi.md#redeployUI1) | **GET** /api2/json/redeployUI | Redeploy UI from current dev branch.
[**redeployUI**](AdminApi.md#redeployUI) | **GET** /api2/json/redeployUI | Redeploy UI from current dev branch.
[**redeployUI1**](AdminApi.md#redeployUI1) | **GET** /api2/json/redeployUI/{live} | Redeploy UI from current dev branch.
[**removeUserAccount**](AdminApi.md#removeUserAccount) | **GET** /api2/json/removeUserAccount/{token} | Remove the user account.
[**removeUserAccountOnBehalf**](AdminApi.md#removeUserAccountOnBehalf) | **GET** /api2/json/removeUserAccountOnBehalf/{apiKey} | Remove (on behalf) a user account.
[**shutdown**](AdminApi.md#shutdown) | **GET** /api2/json/shutdown | Stop learning and shutdown system.
Expand Down Expand Up @@ -355,9 +355,9 @@ This endpoint does not need any parameter.

<a name="availablePlans"></a>
# **availablePlans**
> APIPlansOut availablePlans(token)
> APIPlansOut availablePlans()
List all available plans in the user&#39;s preferred currency.
List all available plans in the default currency (usd).

### Example
```java
Expand All @@ -377,9 +377,8 @@ api_key.setApiKey("YOUR API KEY");
//api_key.setApiKeyPrefix("Token");

AdminApi apiInstance = new AdminApi();
String token = "token_example"; // String |
try {
APIPlansOut result = apiInstance.availablePlans(token);
APIPlansOut result = apiInstance.availablePlans();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdminApi#availablePlans");
Expand All @@ -388,10 +387,7 @@ try {
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**token** | **String**| |
This endpoint does not need any parameter.

### Return type

Expand All @@ -408,9 +404,9 @@ Name | Type | Description | Notes

<a name="availablePlans1"></a>
# **availablePlans1**
> APIPlansOut availablePlans1()
> APIPlansOut availablePlans1(token)
List all available plans in the default currency (usd).
List all available plans in the user&#39;s preferred currency.

### Example
```java
Expand All @@ -430,8 +426,9 @@ api_key.setApiKey("YOUR API KEY");
//api_key.setApiKeyPrefix("Token");

AdminApi apiInstance = new AdminApi();
String token = "token_example"; // String |
try {
APIPlansOut result = apiInstance.availablePlans1();
APIPlansOut result = apiInstance.availablePlans1(token);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AdminApi#availablePlans1");
Expand All @@ -440,7 +437,10 @@ try {
```

### Parameters
This endpoint does not need any parameter.

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**token** | **String**| |

### Return type

Expand Down Expand Up @@ -1127,7 +1127,7 @@ Name | Type | Description | Notes

<a name="redeployUI"></a>
# **redeployUI**
> redeployUI(live)
> redeployUI()
Redeploy UI from current dev branch.

Expand All @@ -1149,20 +1149,16 @@ api_key.setApiKey("YOUR API KEY");
//api_key.setApiKeyPrefix("Token");

AdminApi apiInstance = new AdminApi();
Boolean live = true; // Boolean |
try {
apiInstance.redeployUI(live);
apiInstance.redeployUI();
} catch (ApiException e) {
System.err.println("Exception when calling AdminApi#redeployUI");
e.printStackTrace();
}
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**live** | **Boolean**| |
This endpoint does not need any parameter.

### Return type

Expand All @@ -1179,7 +1175,7 @@ null (empty response body)

<a name="redeployUI1"></a>
# **redeployUI1**
> redeployUI1()
> redeployUI1(live)
Redeploy UI from current dev branch.

Expand All @@ -1201,16 +1197,20 @@ api_key.setApiKey("YOUR API KEY");
//api_key.setApiKeyPrefix("Token");

AdminApi apiInstance = new AdminApi();
Boolean live = true; // Boolean |
try {
apiInstance.redeployUI1();
apiInstance.redeployUI1(live);
} catch (ApiException e) {
System.err.println("Exception when calling AdminApi#redeployUI1");
e.printStackTrace();
}
```

### Parameters
This endpoint does not need any parameter.

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**live** | **Boolean**| |

### Return type

Expand Down
Loading

0 comments on commit e82a853

Please sign in to comment.