diff --git a/pom.xml b/pom.xml index 8081a14a..d1a59d44 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.bullhorn sdk-rest - 2.3.11 + 2.3.12 jar Bullhorn REST SDK diff --git a/src/main/java/com/bullhornsdk/data/api/BullhornData.java b/src/main/java/com/bullhornsdk/data/api/BullhornData.java index 35dcac86..36002e81 100644 --- a/src/main/java/com/bullhornsdk/data/api/BullhornData.java +++ b/src/main/java/com/bullhornsdk/data/api/BullhornData.java @@ -24,17 +24,7 @@ import com.bullhornsdk.data.model.enums.MetaParameter; import com.bullhornsdk.data.model.enums.SettingsFields; import com.bullhornsdk.data.model.file.FileMeta; -import com.bullhornsdk.data.model.parameter.AssociationParams; -import com.bullhornsdk.data.model.parameter.CorpNotesParams; -import com.bullhornsdk.data.model.parameter.FastFindParams; -import com.bullhornsdk.data.model.parameter.FileParams; -import com.bullhornsdk.data.model.parameter.OptionsParams; -import com.bullhornsdk.data.model.parameter.QueryParams; -import com.bullhornsdk.data.model.parameter.ResumeAsNewEntityParams; -import com.bullhornsdk.data.model.parameter.ResumeFileParseParams; -import com.bullhornsdk.data.model.parameter.ResumeTextParseParams; -import com.bullhornsdk.data.model.parameter.SearchParams; -import com.bullhornsdk.data.model.parameter.SettingsParams; +import com.bullhornsdk.data.model.parameter.*; import com.bullhornsdk.data.model.parameter.standard.ParamFactory; import com.bullhornsdk.data.model.response.crud.CrudResponse; import com.bullhornsdk.data.model.response.edithistory.EditHistoryListWrapper; @@ -73,19 +63,31 @@ public interface BullhornData { */ public > L findMultipleEntity(Class type, Set idList, Set fieldSet); - /** - * Returns the entity of passed in type with the passed in id, fields to get are specifed by the fieldSet. - * - * @param type type of BullhornEntity - * @param id id of BullhornEntity - * @param fieldSet fields to query for - * - * @throws RestApiException when the api call fails + /** + * Returns the entity of passed in type with the passed in id, fields to get are specifed by the fieldSet. * - * @return an entity of type T, or null if an error occurred - */ - public T findEntity(Class type, Integer id, Set fieldSet); + * @param type type of BullhornEntity + * @param id id of BullhornEntity + * @param fieldSet fields to query for + * @return an entity of type T, or null if an error occurred + * @throws RestApiException when the api call fails + */ + public default T findEntity(Class type, Integer id, Set fieldSet) { + return findEntity(type, id, fieldSet, ParamFactory.entityParams()); + } + /** + * Returns the entity of passed in type with the passed in id, fields to get are specifed by the fieldSet. + * + * @param type type of BullhornEntity + * @param id id of BullhornEntity + * @param fieldSet fields to query for + * @param entityParams extra parameters for query + * @throws RestApiException when the api call fails + * + * @return an entity of type T, or null if an error occurred + */ + public T findEntity(Class type, Integer id, Set fieldSet, EntityParams entityParams); /** * Queries for QueryEntity of type T and returns a List. * diff --git a/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java b/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java index 40083f6c..c762763a 100644 --- a/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java +++ b/src/main/java/com/bullhornsdk/data/api/StandardBullhornData.java @@ -220,8 +220,8 @@ public void setHttpRequestReadTimeout(int readTimeout) { * {@inheritDoc} */ @Override - public T findEntity(Class type, Integer id, Set fieldSet) { - return this.handleGetEntity(type, id, fieldSet, ParamFactory.entityParams()); + public T findEntity(Class type, Integer id, Set fieldSet, EntityParams entityParams) { + return this.handleGetEntity(type, id, fieldSet, entityParams); } /** diff --git a/src/main/java/com/bullhornsdk/data/api/mock/MockBullhornData.groovy b/src/main/java/com/bullhornsdk/data/api/mock/MockBullhornData.groovy index 33f03583..cc794afd 100644 --- a/src/main/java/com/bullhornsdk/data/api/mock/MockBullhornData.groovy +++ b/src/main/java/com/bullhornsdk/data/api/mock/MockBullhornData.groovy @@ -69,7 +69,7 @@ public class MockBullhornData implements BullhornData { } @Override - public T findEntity(Class type, Integer id, Set fieldSet) { + public T findEntity(Class type, Integer id, Set fieldSet, EntityParams entityParams) { return mockDataHandler.findEntity(type, id, fieldSet); } diff --git a/src/main/java/com/bullhornsdk/data/model/parameter/EntityParams.java b/src/main/java/com/bullhornsdk/data/model/parameter/EntityParams.java index 516db3b9..b7e8c9a0 100644 --- a/src/main/java/com/bullhornsdk/data/model/parameter/EntityParams.java +++ b/src/main/java/com/bullhornsdk/data/model/parameter/EntityParams.java @@ -1,11 +1,40 @@ package com.bullhornsdk.data.model.parameter; +import java.time.LocalDate; + /** * Optional parameters for the "entity" api call. - * + * * @author magnus.palm - * */ public interface EntityParams extends RequestParameters { + /** + * Returns whether to show the _editable field in responses. + * + * @return the flag value + */ + Boolean getShowEditable(); + + /** + * Whether to show the _editable field in responses. The _editable field indicates whether an entity is editable. + * Setting showEditable to true results in slower performance; use this setting sparingly and only when needed. + * + * @param showEditable the flag value + */ + void setShowEditable(Boolean showEditable); + + /** + * Returns the date limitation query on an effective-dated entity. + * + * @return The date limit + */ + LocalDate getEffectiveOn(); + + /** + * Limit the request to a specific date. Only works on Effective-Dated entities + * + * @param effectiveOn The date limitation + */ + void setEffectiveOn(LocalDate effectiveOn); } diff --git a/src/main/java/com/bullhornsdk/data/model/parameter/standard/StandardEntityParams.java b/src/main/java/com/bullhornsdk/data/model/parameter/standard/StandardEntityParams.java index 11f07510..c88f518a 100644 --- a/src/main/java/com/bullhornsdk/data/model/parameter/standard/StandardEntityParams.java +++ b/src/main/java/com/bullhornsdk/data/model/parameter/standard/StandardEntityParams.java @@ -1,13 +1,17 @@ package com.bullhornsdk.data.model.parameter.standard; import com.bullhornsdk.data.model.parameter.EntityParams; +import lombok.Data; +import java.time.LocalDate; import java.util.LinkedHashMap; import java.util.Map; +@Data public class StandardEntityParams implements EntityParams { - private boolean showEditable; + private Boolean showEditable; + private LocalDate effectiveOn; private StandardEntityParams() { super(); @@ -19,11 +23,6 @@ public static StandardEntityParams getInstance() { return params; } - - public void setShowEditable(boolean showEditable) { - this.showEditable = showEditable; - } - @Override public String getUrlString() { StringBuilder url = new StringBuilder(); @@ -32,6 +31,10 @@ public String getUrlString() { url.append("&showEditable={showEditable}"); } + if (effectiveOn != null) { + url.append("&effectiveOn={effectiveOn}"); + } + return url.toString(); } @@ -43,6 +46,10 @@ public Map getParameterMap() { uriVariables.put("showEditable", "" + true); } + if (effectiveOn != null) { + uriVariables.put("effectiveOn", effectiveOn.toString()); + } + return uriVariables; }