Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.adobe.stock</groupId>
<artifactId>stockapissdk</artifactId>
<artifactId>stock-api</artifactId>
<packaging>bundle</packaging>
<version>1.0.1</version>
<version>1.0.2</version>
<name>Adobe Stock Apis SDK</name>
<description>A Java sdk for Adobe Stock APIs</description>
<licenses>
Expand Down
16 changes: 9 additions & 7 deletions src/main/java/com/adobe/stock/client/AdobeStockClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Expand Down Expand Up @@ -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();
}

}
26 changes: 25 additions & 1 deletion src/main/java/com/adobe/stock/models/StockFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down