Skip to content

Commit c8f2d35

Browse files
authored
Merge pull request #3 from csamanie/STK-28391
STK-28391 Stock Java SDK is not returning isEditorial flag
2 parents b89dd74 + 5b1d92e commit c8f2d35

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.adobe.stock</groupId>
6-
<artifactId>stockapissdk</artifactId>
6+
<artifactId>stock-api</artifactId>
77
<packaging>bundle</packaging>
8-
<version>1.0.1</version>
8+
<version>1.0.2</version>
99
<name>Adobe Stock Apis SDK</name>
1010
<description>A Java sdk for Adobe Stock APIs</description>
1111
<licenses>

src/main/java/com/adobe/stock/client/AdobeStockClient.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,26 @@ public static void testSearchFiles() throws StockException {
4343
.setApiKey("AdobeStockClient1")
4444
.setProduct("Adobe Stock Lib/1.0.0")
4545
.setTargetEnvironment(Environment.STAGE)
46-
.setProductLocation("Libraries/1.0.0 ");
47-
ResultColumn[] columns = { ResultColumn.STOCK_ID,
46+
.setProductLocation("libraries/2.10");
47+
ResultColumn[] columns = { ResultColumn.ID,
4848
ResultColumn.MEDIA_TYPE_ID, ResultColumn.NB_RESULTS,
49-
ResultColumn.WIDTH, ResultColumn.COUNTRY_NAME };
50-
SearchParameters params = new SearchParameters().setWords("tree")
51-
.setLimit(10).setOffset(10);
49+
ResultColumn.WIDTH, ResultColumn.COUNTRY_NAME, ResultColumn.IS_EDITORIAL };
50+
SearchParameters params = new SearchParameters().setWords("dogs")
51+
.setFilterEditorial(true).setLimit(10).setOffset(10);
5252
SearchFilesRequest request = new SearchFilesRequest()
5353
.setSearchParams(params).setResultColumns(columns);
5454
SearchFiles searchFile = new SearchFiles(config, null, request);
5555
SearchFilesResponse response = searchFile.getNextResponse();
5656
System.out.println("Search Files Response:");
5757
print("total results", response.getNbResults());
58-
print("stock id", response.getFiles().get(0).getStockId());
58+
print("id", response.getFiles().get(0).getId());
5959
print("asset id", response.getFiles().get(0).getAssetTypeId());
6060
print("width", response.getFiles().get(0).getWidth());
6161
print("country", response.getFiles().get(0).getCountryName());
62+
print("editorial", response.getFiles().get(0).getIsEditorial());
6263
System.out.println("");
6364
} catch (Exception e) {
65+
6466
throw new StockException("error in search files");
6567
}
6668
}
@@ -235,7 +237,7 @@ public static void print(String key, Object val) {
235237
System.out.println(key + " : " + val.toString());
236238
}
237239
public static void main(String[] args) throws StockException {
238-
testSelectEntitlement();
240+
testSearchFiles();
239241
}
240242

241243
}

src/main/java/com/adobe/stock/models/StockFile.java

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,11 @@ public final class StockFile {
250250
* assets.
251251
*/
252252
private Boolean mIsPremium;
253-
253+
/**
254+
* True for editorial assets, false for non editorial.
255+
* assets.
256+
*/
257+
private Boolean mIsEditorial;
254258
/**
255259
* Contains available licenses for the media.
256260
*/
@@ -787,6 +791,15 @@ public Boolean getIsPremium() {
787791
return mIsPremium;
788792
}
789793

794+
/**
795+
* Checks if editorial asset.
796+
*
797+
* @return true for editorial assets and false for non editorial assets
798+
*/
799+
public Boolean getIsEditorial() {
800+
return mIsEditorial;
801+
}
802+
790803
/**
791804
* Get available licenses for the media.
792805
*
@@ -1506,6 +1519,17 @@ public void setIsPremium(final Boolean isPremium) {
15061519
this.mIsPremium = isPremium;
15071520
}
15081521

1522+
/**
1523+
* Sets if editorial asset.
1524+
*
1525+
* @param isEditorial
1526+
* true for editorial assets and false for non editorial assets
1527+
*/
1528+
@JsonSetter("is_editorial")
1529+
public void setIsEditorial(final Boolean isEditorial) {
1530+
this.mIsEditorial = isEditorial;
1531+
}
1532+
15091533
/**
15101534
* Sets available licenses for the media.
15111535
*

0 commit comments

Comments
 (0)