Skip to content

Commit

Permalink
feat: include metadata function support added [CS-36641]
Browse files Browse the repository at this point in the history
  • Loading branch information
uttamukkoji committed Mar 28, 2023
1 parent 5d08a44 commit 1e16a9b
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 2 deletions.
16 changes: 16 additions & 0 deletions Contentstack/Asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,22 @@ BUILT_ASSUME_NONNULL_BEGIN
*/
- (void)removeHeaderForKey:(NSString *)headerKey;

/**
Include the metadata for getting metadata content for the asset.
//Obj-C
Stack *stack = [Contentstack stackWithAPIKey:@"API_KEY" accessToken:@"DELIVERY_TOKEN" environmentName:@"ENVIRONMENT"];
Asset *asset = [stack asset];
[asset includeMetadata];
//Swift
var stack:Stack = Contentstack.stackWithAPIKey("API_KEY", accessToken:"DELIVERY_TOKEN", environmentName:@"ENVIRONMENT")
var asset:Asset = stack.asset()
asset.includeMetadata()
*/
-(void)includeMetadata;

/**
Retrieve the published content of the fallback locale entry if the entry is not localized in specified locale.
Expand Down
4 changes: 4 additions & 0 deletions Contentstack/Asset.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ -(void)includeFallback {
[self.postParamDictionary setObject:@"true" forKey:kCSIO_IncludeFallback];
}

-(void)includeMetadata {
[self.postParamDictionary setObject:@"true" forKey:kCSIO_IncludeMetadata];
}

-(void)includeBranch {
[self.postParamDictionary setObject:@"true" forKey:kCSIO_IncludeBranch];
}
Expand Down
12 changes: 12 additions & 0 deletions Contentstack/AssetLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ typedef NS_ENUM(NSUInteger, OrderBy) {
*/
-(void)includeFallback;

/**
Include the metadata for getting metadata content for the asset.
//Obj-C
[assetLib includeMetadata];
//Swift
assetLib.includeMetadata()
*/
-(void)includeMetadata;

/**
Retrieve the branch for the published content.
Expand Down
4 changes: 4 additions & 0 deletions Contentstack/AssetLibrary.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ -(void)includeFallback {
[self.postParamDictionary setObject:@"true" forKey:kCSIO_IncludeFallback];
}

-(void)includeMetadata {
[self.postParamDictionary setObject:@"true" forKey:kCSIO_IncludeMetadata];
}

-(void)includeBranch {
[self.postParamDictionary setObject:@"true" forKey:kCSIO_IncludeBranch];
}
Expand Down
16 changes: 14 additions & 2 deletions Contentstack/Entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,26 @@ BUILT_ASSUME_NONNULL_BEGIN
Retrieve the published content of the fallback locale entry if the entry is not localized in specified locale.
//Obj-C
[entryObj includeContentType];
[entryObj includeFallback];
//Swift
entryObj.includeContentType()
entryObj.includeFallback()
*/
-(void)includeFallback;

/**
Include the metadata for getting metadata content for the entry.
//Obj-C
[entryObj includeMetadata];
//Swift
entryObj.includeMetadata()
*/
-(void)includeMetadata;

/**
Retrieve the branch for the published content.
Expand Down
4 changes: 4 additions & 0 deletions Contentstack/Entry.m
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ -(void)includeFallback {
[self.postParamDictionary setObject:@"true" forKey:kCSIO_IncludeFallback];
}

-(void)includeMetadata {
[self.postParamDictionary setObject:@"true" forKey:kCSIO_IncludeMetadata];
}

-(void)includeBranch {
[self.postParamDictionary setObject:@"true" forKey:kCSIO_IncludeBranch];
}
Expand Down
11 changes: 11 additions & 0 deletions Contentstack/Query.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,17 @@ Provides only the number of entries with values matching the specified values fo
*/
-(void)includeFallback;

/**
Include the metadata for getting metadata content for the entry.
//Obj-C
[blogQuery includeMetadata];
//Swift
blogQuery.includeMetadata()
*/
-(void)includeMetadata;
/**
Retrieve the branch for the published content.
Expand Down
4 changes: 4 additions & 0 deletions Contentstack/Query.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ -(void)includeFallback {
[self.queryDictionary setObject:@"true" forKey:kCSIO_IncludeFallback];
}

-(void)includeMetadata {
[self.queryDictionary setObject:@"true" forKey:kCSIO_IncludeMetadata];
}

-(void)includeBranch {
[self.queryDictionary setObject:@"true" forKey:kCSIO_IncludeBranch];
}
Expand Down
1 change: 1 addition & 0 deletions ContentstackInternal/CSIOConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ @implementation CSIOConstants
NSString *const kCSIO_IncludeCount = @"include_count";
NSString *const kCSIO_IncludeUnpublished = @"include_unpublished";
NSString *const kCSIO_IncludeFallback = @"include_fallback";
NSString *const kCSIO_IncludeMetadata = @"include_metadata";
NSString *const kCSIO_IncludeBranch = @"include_branch";
NSString *const kCSIO_IncludeEmbeddedItems = @"include_embedded_items";

Expand Down

0 comments on commit 1e16a9b

Please sign in to comment.