Skip to content

Commit 4509967

Browse files
author
JW Wesson
committed
rename for clarity
1 parent 8e1b54e commit 4509967

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/main/java/com/sovren/ApiEndpoints.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private String sanitize(String indexOrDocId) throws IllegalArgumentException {
9191
String desProfessionsNormalize() { return prefix(false) + "/professions/normalize"; }
9292
String desProfessionsLookup() { return prefix(false) + "/professions/lookup"; }
9393
String desProfessionsAutoComplete() { return prefix(false) + "/professions/autoComplete"; }
94-
String desOntologySuggestSkills() { return prefix(false) + "/ontology/suggestSkills"; }
94+
String desOntologySuggestSkillsFromProfessions() { return prefix(false) + "/ontology/suggestSkills"; }
9595
String desOntologyCompareProfessions() { return prefix(false) + "/ontology/compareProfessions"; }
9696
String desOntologySuggestProfessions() { return prefix(false) + "/ontology/suggestProfessions"; }
9797
String desOntologyCompareSkillsToProfession() { return prefix(false) + "/ontology/compareSkillsToProfession"; }

src/main/java/com/sovren/SovrenClient.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import com.sovren.models.api.dataenrichment.ontology.request.CompareProfessionsRequest;
2121
import com.sovren.models.api.dataenrichment.ontology.request.CompareSkillsToProfessionRequest;
2222
import com.sovren.models.api.dataenrichment.ontology.request.SuggestProfessionsRequest;
23-
import com.sovren.models.api.dataenrichment.ontology.request.SuggestSkillsRequest;
23+
import com.sovren.models.api.dataenrichment.ontology.request.SuggestSkillsFromProfessionsRequest;
2424
import com.sovren.models.api.dataenrichment.ontology.response.CompareProfessionsResponse;
2525
import com.sovren.models.api.dataenrichment.ontology.response.CompareSkillsToProfessionResponse;
2626
import com.sovren.models.api.dataenrichment.ontology.response.SuggestProfessionsResponse;
@@ -1657,14 +1657,14 @@ public CompareSkillsToProfessionResponse compareSkillsToProfessions(ParsedResume
16571657
* @return The API response body
16581658
* @throws SovrenException Thrown when an API error occurs
16591659
*/
1660-
public SuggestSkillsResponse suggestSkills(List<Integer> professionCodeIds, int limit) throws SovrenException {
1661-
SuggestSkillsRequest request = new SuggestSkillsRequest();
1660+
public SuggestSkillsResponse suggestSkillsFromProfessions(List<Integer> professionCodeIds, int limit) throws SovrenException {
1661+
SuggestSkillsFromProfessionsRequest request = new SuggestSkillsFromProfessionsRequest();
16621662
request.ProfessionCodeIds = professionCodeIds;
16631663
request.Limit = limit;
16641664

16651665
RequestBody body = createJsonBody(request);
16661666
Request apiRequest = new Request.Builder()
1667-
.url(_endpoints.desOntologySuggestSkills())
1667+
.url(_endpoints.desOntologySuggestSkillsFromProfessions())
16681668
.post(body)
16691669
.build();
16701670

@@ -1678,8 +1678,8 @@ public SuggestSkillsResponse suggestSkills(List<Integer> professionCodeIds, int
16781678
* @return The API response body
16791679
* @throws SovrenException Thrown when an API error occurs
16801680
*/
1681-
public SuggestSkillsResponse suggestSkills(List<Integer> professionCodeIds) throws SovrenException {
1682-
return suggestSkills(professionCodeIds, 10);
1681+
public SuggestSkillsResponse suggestSkillsFromProfessions(List<Integer> professionCodeIds) throws SovrenException {
1682+
return suggestSkillsFromProfessions(professionCodeIds, 10);
16831683
}
16841684

16851685
/**
@@ -1689,7 +1689,7 @@ public SuggestSkillsResponse suggestSkills(List<Integer> professionCodeIds) thro
16891689
* @return The API response body
16901690
* @throws SovrenException Thrown when an API error occurs
16911691
*/
1692-
public SuggestSkillsResponse suggestSkills(ParsedResume resume, int limit) throws SovrenException {
1692+
public SuggestSkillsResponse suggestSkillsFromProfessions(ParsedResume resume, int limit) throws SovrenException {
16931693
if(resume != null && resume.EmploymentHistory != null && resume.EmploymentHistory.Positions != null){
16941694
List<Integer> normalizedProfs = new ArrayList<Integer>();
16951695
for(Position position: resume.EmploymentHistory.Positions){
@@ -1699,7 +1699,7 @@ public SuggestSkillsResponse suggestSkills(ParsedResume resume, int limit) throw
16991699
}
17001700

17011701
if (normalizedProfs.size() > 0){
1702-
return suggestSkills(normalizedProfs,limit);
1702+
return suggestSkillsFromProfessions(normalizedProfs,limit);
17031703
}
17041704
}
17051705
throw new IllegalArgumentException("No professions were found in the resume, or the resume was parsed without professions normalization enabled");
@@ -1711,8 +1711,8 @@ public SuggestSkillsResponse suggestSkills(ParsedResume resume, int limit) throw
17111711
* @return The API response body
17121712
* @throws SovrenException Thrown when an API error occurs
17131713
*/
1714-
public SuggestSkillsResponse suggestSkills(ParsedResume resume) throws SovrenException {
1715-
return suggestSkills(resume, 10);
1714+
public SuggestSkillsResponse suggestSkillsFromProfessions(ParsedResume resume) throws SovrenException {
1715+
return suggestSkillsFromProfessions(resume, 10);
17161716
}
17171717

17181718
/**
@@ -1722,12 +1722,12 @@ public SuggestSkillsResponse suggestSkills(ParsedResume resume) throws SovrenExc
17221722
* @return The API response body
17231723
* @throws SovrenException Thrown when an API error occurs
17241724
*/
1725-
public SuggestSkillsResponse suggestSkills(ParsedJob job, int limit) throws SovrenException {
1725+
public SuggestSkillsResponse suggestSkillsFromProfessions(ParsedJob job, int limit) throws SovrenException {
17261726
if(job != null && job.JobTitles != null && job.JobTitles.NormalizedProfession != null && job.JobTitles.NormalizedProfession.Profession != null && job.JobTitles.NormalizedProfession.Profession.CodeId != null){
17271727
List<Integer> ids = new ArrayList<Integer>();
17281728
ids.add(job.JobTitles.NormalizedProfession.Profession.CodeId);
17291729

1730-
return suggestSkills(ids,limit);
1730+
return suggestSkillsFromProfessions(ids,limit);
17311731
}
17321732
throw new IllegalArgumentException("No professions were found in the job, or the job was parsed without professions normalization enabled");
17331733
}
@@ -1738,8 +1738,8 @@ public SuggestSkillsResponse suggestSkills(ParsedJob job, int limit) throws Sovr
17381738
* @return The API response body
17391739
* @throws SovrenException Thrown when an API error occurs
17401740
*/
1741-
public SuggestSkillsResponse suggestSkills(ParsedJob job) throws SovrenException {
1742-
return suggestSkills(job, 10);
1741+
public SuggestSkillsResponse suggestSkillsFromProfessions(ParsedJob job) throws SovrenException {
1742+
return suggestSkillsFromProfessions(job, 10);
17431743
}
17441744

17451745
/**

src/main/java/com/sovren/models/api/dataenrichment/ontology/request/SuggestSkillsRequest.java renamed to src/main/java/com/sovren/models/api/dataenrichment/ontology/request/SuggestSkillsFromProfessionsRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.util.List;
99

1010
/** Request body for a 'SuggestSkills' request */
11-
public class SuggestSkillsRequest {
11+
public class SuggestSkillsFromProfessionsRequest {
1212
/** The profession code IDs from the <a href="https://sovren.com/technical-specs/latest/rest-api/data-enrichment/overview/#professions-taxonomies">Professions Taxonomy</a> for which the service should return related skills. The list can contain up to 10 profession codes. */
1313
public List<Integer> ProfessionCodeIds;
1414
/** The maximum amount of suggested skills returned. If not specified this parameter defaults to 10. This limit cannot exceed 10. */

src/test/java/com/sovren/integration/DataEnrichmentServiceTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ public void testCompareSkillsToProfessions() {
121121
}
122122

123123
@Test
124-
public void testSuggestSkills() {
124+
public void testSuggestSkillsFromProfessions() {
125125
assertDoesNotThrow(() -> {
126126
ArrayList<Integer> professionCodeIds = new ArrayList<Integer>();
127127
professionCodeIds.add(696);
128-
Client.suggestSkills(professionCodeIds, 10);
128+
Client.suggestSkillsFromProfessions(professionCodeIds, 10);
129129
});
130130
}
131131

0 commit comments

Comments
 (0)