Skip to content

Commit 3171cfe

Browse files
feat/CS-37219-azure-eu-and-include-metadata
feat/CS-37219-azure-eu-and-include-metadata
1 parent 0263dba commit 3171cfe

File tree

11 files changed

+95
-332
lines changed

11 files changed

+95
-332
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# CHANGELOG
22

3+
## v1.12.0
4+
5+
### Date: 25-APR-2023
6+
7+
- Include metadata support for Asset, Entry and Query,
8+
- Region support for Azure-EU added
9+
310
## v1.11.0
411

512
### Date: 09-FEB-2023

src/main/java/com/contentstack/sdk/Asset.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ public Asset includeBranch() {
531531
}
532532

533533
/**
534-
* Includes Owner in the asset response
534+
* Includes Metadata in the asset response
535535
*
536536
* @return {@link Asset} object, so you can chain this call. <br>
537537
*
@@ -542,11 +542,11 @@ public Asset includeBranch() {
542542
* <pre class="prettyprint">
543543
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
544544
* Asset asset = stack.asset(asset_uid);
545-
* asset.includeOwner();
545+
* asset.includeMetadata();
546546
* </pre>
547547
*/
548-
public Asset includeOwner() {
549-
urlQueries.put("include_owner", true);
548+
public Asset includeMetadata() {
549+
urlQueries.put("include_metadata", true);
550550
return this;
551551
}
552552

src/main/java/com/contentstack/sdk/AssetLibrary.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public AssetLibrary includeFallback() {
112112
}
113113

114114
/**
115-
* Retrieve an owner in the response
115+
* Retrieve Metadata in the response
116116
*
117117
* @return {@link AssetLibrary} object, so you can chain this call. <br>
118118
* <br>
@@ -121,11 +121,11 @@ public AssetLibrary includeFallback() {
121121
* <pre class="prettyprint">
122122
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
123123
* AssetLibrary assetLibObject = stack.includeOwner();
124-
* AssetLibrary.includeFallback();
124+
* AssetLibrary.includeMetadata();
125125
* </pre>
126126
*/
127-
public AssetLibrary includeOwner() {
128-
urlQueries.put("include_owner", true);
127+
public AssetLibrary includeMetadata() {
128+
urlQueries.put("include_metadata", true);
129129
return this;
130130
}
131131

src/main/java/com/contentstack/sdk/Entry.java

Lines changed: 42 additions & 42 deletions
Large diffs are not rendered by default.

src/main/java/com/contentstack/sdk/Query.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,7 @@ public Query includeBranch() {
14581458
}
14591459

14601460
/**
1461-
* Includes Owner in the entry response
1461+
* Includes Metadata in the entry response
14621462
*
14631463
* @return {@link Query} object, so you can chain this call. <br>
14641464
*
@@ -1469,11 +1469,11 @@ public Query includeBranch() {
14691469
* <pre class="prettyprint">
14701470
* Stack stack = Contentstack.stack("apiKey", "deliveryToken", "environment");
14711471
* Query query = stack.contentType("contentTypeUid").query();
1472-
* entry.includeOwner();
1472+
* entry.includeMetadata();
14731473
* </pre>
14741474
*/
1475-
public Query includeOwner() {
1476-
urlQueries.put("include_owner", true);
1475+
public Query includeMetadata() {
1476+
urlQueries.put("include_metadata", true);
14771477
return this;
14781478
}
14791479
}

src/main/java/com/contentstack/sdk/Stack.java

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public void sync(SyncResultCallBack syncCallBack) {
351351
* stack.syncPaginationToken("paginationToken)
352352
*/
353353
public void syncPaginationToken(@NotNull String paginationToken, SyncResultCallBack syncCallBack) {
354-
this.sync(null);
354+
syncParams = new JSONObject();
355355
syncParams.put("pagination_token", paginationToken);
356356
this.requestSync(syncCallBack);
357357
}
@@ -370,13 +370,13 @@ public void syncPaginationToken(@NotNull String paginationToken, SyncResultCallB
370370
* <br>
371371
* <b>Example :</b><br>
372372
* <pre class="prettyprint">
373-
* Stack stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
374-
* stack.syncToken("syncToken")
375-
* stack.syncToken(sync_token, new SyncResultCallBack() ){ }
376-
* </pre>
373+
* Stack stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
374+
* stack.syncToken("syncToken")
375+
* stack.syncToken(sync_token, new SyncResultCallBack() ){ }
376+
* </pre>
377377
*/
378378
public void syncToken(String syncToken, SyncResultCallBack syncCallBack) {
379-
this.sync(null);
379+
syncParams = new JSONObject();
380380
syncParams.put("sync_token", syncToken);
381381
this.requestSync(syncCallBack);
382382
}
@@ -398,7 +398,8 @@ public void syncToken(String syncToken, SyncResultCallBack syncCallBack) {
398398
*/
399399
public void syncFromDate(@NotNull Date fromDate, SyncResultCallBack syncCallBack) {
400400
String newFromDate = convertUTCToISO(fromDate);
401-
this.sync(null);
401+
syncParams = new JSONObject();
402+
syncParams.put("init", true);
402403
syncParams.put("start_from", newFromDate);
403404
this.requestSync(syncCallBack);
404405
}
@@ -427,7 +428,8 @@ protected String convertUTCToISO(Date date) {
427428
* stack.syncContentType(String content_type, new SyncResultCallBack()){ }
428429
*/
429430
public void syncContentType(@NotNull String contentType, SyncResultCallBack syncCallBack) {
430-
this.sync(null);
431+
syncParams = new JSONObject();
432+
syncParams.put("init", true);
431433
syncParams.put(CONTENT_TYPE_UID, contentType);
432434
this.requestSync(syncCallBack);
433435
}
@@ -449,7 +451,8 @@ public void syncContentType(@NotNull String contentType, SyncResultCallBack sync
449451
* content_type, new SyncResultCallBack()){ }
450452
*/
451453
public void syncLocale(String localeCode, SyncResultCallBack syncCallBack) {
452-
this.sync(null);
454+
syncParams = new JSONObject();
455+
syncParams.put("init", true);
453456
syncParams.put("locale", localeCode);
454457
this.requestSync(syncCallBack);
455458
}
@@ -472,13 +475,14 @@ public void syncLocale(String localeCode, SyncResultCallBack syncCallBack) {
472475
* <br>
473476
* <br>
474477
* <b>Example :</b><br>
475-
* <pre class="prettyprint">
476-
* Stack stack = contentstack.Stack("apiKey", "deliveryToken", "environment");
477-
* stack.syncPublishType(PublishType)
478-
* </pre>
478+
* <code>
479+
* Stack stack = contentstack.Stack("apiKey", "deliveryToken", "environment"); *
480+
* stack.syncPublishType(PublishType)
481+
* </code>
479482
*/
480483
public void syncPublishType(PublishType publishType, SyncResultCallBack syncCallBack) {
481-
this.sync(null);
484+
syncParams = new JSONObject();
485+
syncParams.put("init", true);
482486
syncParams.put("type", publishType.name().toLowerCase());
483487
this.requestSync(syncCallBack);
484488
}
@@ -506,7 +510,8 @@ public void syncPublishType(PublishType publishType, SyncResultCallBack syncCall
506510
public void sync(String contentType, Date fromDate, String localeCode,
507511
PublishType publishType, SyncResultCallBack syncCallBack) {
508512
String newDate = convertUTCToISO(fromDate);
509-
this.sync(null);
513+
syncParams = new JSONObject();
514+
syncParams.put("init", true);
510515
syncParams.put("start_from", newDate);
511516
syncParams.put("content_type_uid", contentType);
512517
syncParams.put("type", publishType.name());

src/test/java/com/contentstack/sdk/TestAsset.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ void testAssetIncludeBranch() {
186186
@Test
187187
void testAssetIncludeOwner() {
188188
Asset asset = stack.asset("fake@uid");
189-
asset.includeOwner();
190-
Assertions.assertTrue(asset.urlQueries.has("include_owner"));
189+
asset.includeMetadata();
190+
Assertions.assertTrue(asset.urlQueries.has("include_metadata"));
191191
}
192192

193193
}

src/test/java/com/contentstack/sdk/TestAssetLibrary.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void testIncludeFallback() {
113113

114114
@Test
115115
void testIncludeOwner() {
116-
AssetLibrary assetLibrary = stack.assetLibrary().includeOwner();
116+
AssetLibrary assetLibrary = stack.assetLibrary().includeMetadata();
117117
Assertions.assertFalse(assetLibrary.headers.containsKey("include_owner"));
118118
logger.info("passed...");
119119
}

0 commit comments

Comments
 (0)