diff --git a/pom.xml b/pom.xml index 607cd6e..8998421 100644 --- a/pom.xml +++ b/pom.xml @@ -3,9 +3,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.adobe.stock - stockapissdk + stock-api bundle - 1.0.1 + 1.0.2 Adobe Stock Apis SDK A Java sdk for Adobe Stock APIs diff --git a/src/main/java/com/adobe/stock/client/AdobeStockClient.java b/src/main/java/com/adobe/stock/client/AdobeStockClient.java index 244b3a7..a3c932b 100644 --- a/src/main/java/com/adobe/stock/client/AdobeStockClient.java +++ b/src/main/java/com/adobe/stock/client/AdobeStockClient.java @@ -43,24 +43,26 @@ public static void testSearchFiles() throws StockException { .setApiKey("AdobeStockClient1") .setProduct("Adobe Stock Lib/1.0.0") .setTargetEnvironment(Environment.STAGE) - .setProductLocation("Libraries/1.0.0 "); - ResultColumn[] columns = { ResultColumn.STOCK_ID, + .setProductLocation("libraries/2.10"); + ResultColumn[] columns = { ResultColumn.ID, ResultColumn.MEDIA_TYPE_ID, ResultColumn.NB_RESULTS, - ResultColumn.WIDTH, ResultColumn.COUNTRY_NAME }; - SearchParameters params = new SearchParameters().setWords("tree") - .setLimit(10).setOffset(10); + ResultColumn.WIDTH, ResultColumn.COUNTRY_NAME, ResultColumn.IS_EDITORIAL }; + SearchParameters params = new SearchParameters().setWords("dogs") + .setFilterEditorial(true).setLimit(10).setOffset(10); SearchFilesRequest request = new SearchFilesRequest() .setSearchParams(params).setResultColumns(columns); SearchFiles searchFile = new SearchFiles(config, null, request); SearchFilesResponse response = searchFile.getNextResponse(); System.out.println("Search Files Response:"); print("total results", response.getNbResults()); - print("stock id", response.getFiles().get(0).getStockId()); + print("id", response.getFiles().get(0).getId()); print("asset id", response.getFiles().get(0).getAssetTypeId()); print("width", response.getFiles().get(0).getWidth()); print("country", response.getFiles().get(0).getCountryName()); + print("editorial", response.getFiles().get(0).getIsEditorial()); System.out.println(""); } catch (Exception e) { + throw new StockException("error in search files"); } } @@ -235,7 +237,7 @@ public static void print(String key, Object val) { System.out.println(key + " : " + val.toString()); } public static void main(String[] args) throws StockException { - testSelectEntitlement(); + testSearchFiles(); } } diff --git a/src/main/java/com/adobe/stock/models/StockFile.java b/src/main/java/com/adobe/stock/models/StockFile.java index 122840c..638cdf9 100644 --- a/src/main/java/com/adobe/stock/models/StockFile.java +++ b/src/main/java/com/adobe/stock/models/StockFile.java @@ -250,7 +250,11 @@ public final class StockFile { * assets. */ private Boolean mIsPremium; - + /** + * True for editorial assets, false for non editorial. + * assets. + */ + private Boolean mIsEditorial; /** * Contains available licenses for the media. */ @@ -787,6 +791,15 @@ public Boolean getIsPremium() { return mIsPremium; } + /** + * Checks if editorial asset. + * + * @return true for editorial assets and false for non editorial assets + */ + public Boolean getIsEditorial() { + return mIsEditorial; + } + /** * Get available licenses for the media. * @@ -1506,6 +1519,17 @@ public void setIsPremium(final Boolean isPremium) { this.mIsPremium = isPremium; } + /** + * Sets if editorial asset. + * + * @param isEditorial + * true for editorial assets and false for non editorial assets + */ + @JsonSetter("is_editorial") + public void setIsEditorial(final Boolean isEditorial) { + this.mIsEditorial = isEditorial; + } + /** * Sets available licenses for the media. *