Class AssetLibrary
Inheritance
Inherited Members
Namespace: Contentstack.Core.Models
Assembly: Contentstack.Core.dll
Syntax
public class AssetLibrary
Properties
| Improve this Doc View SourceStack
Declaration
public ContentstackClient Stack { get; set; }
Property Value
Type | Description |
---|---|
ContentstackClient |
Methods
| Improve this Doc View SourceCount()
Declaration
public async Task<JObject> Count()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Newtonsoft.Json.Linq.JObject> |
Except(String[])
Specifies list of field uids that would be excluded from the response.
Declaration
public AssetLibrary Except(string[] fieldUids)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | fieldUids | field uid which get excluded from the response. |
Returns
Type | Description |
---|---|
AssetLibrary | Current instance of AssetLibrary, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.Except(new String[]{"name", "description"});
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
FetchAll()
Execute a AssetLibrary and Caches its result (Optional)
Declaration
public async Task<ContentstackCollection<Asset>> FetchAll()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<ContentstackCollection<Asset>> | Current instance of AssetLibrary, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
IncludeBranch()
Include branch for publish content.
Declaration
public AssetLibrary IncludeBranch()
Returns
Type | Description |
---|---|
AssetLibrary | Current instance of AssetLibrary, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.IncludeBranch();
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
IncludeCount()
This method also includes the total number of assets returned in the response.
Declaration
public void IncludeCount()
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.IncludeCount();
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
IncludeFallback()
Include fallback locale publish content, if specified locale content is not publish.
Declaration
public AssetLibrary IncludeFallback()
Returns
Type | Description |
---|---|
AssetLibrary | Current instance of AssetLibrary, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.IncludeFallback();
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
IncludeRelativeUrls()
This method includes the relative url of assets.
Declaration
public void IncludeRelativeUrls()
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.IncludeRelativeUrls();
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
Limit(Int32)
A limit on the number of objects to return.
Declaration
public AssetLibrary Limit(int number)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | number | No of objects to limit. |
Returns
Type | Description |
---|---|
AssetLibrary | Current instance of AssetLibrary, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.Limit(20);
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
Only(String[])
Specifies an array of 'only' keys in BASE object that would be 'included' in the response.
Declaration
public AssetLibrary Only(string[] fieldUid)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | fieldUid | Array of the 'only' keys to be included in response. |
Returns
Type | Description |
---|---|
AssetLibrary | Current instance of AssetLibrary, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.Only(new String[]{"name", "description"});
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
RemoveHeader(String)
Remove header key.
Declaration
public AssetLibrary RemoveHeader(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | custom_header_key |
Returns
Type | Description |
---|---|
AssetLibrary |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.RemoveHeader("custom_key");
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
SetHeaderForKey(String, String)
Set headers.
Declaration
public AssetLibrary SetHeaderForKey(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | custom_header_key |
System.String | value | custom_header_value |
Returns
Type | Description |
---|---|
AssetLibrary |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.SetHeaderForKey("custom_header_key", "custom_header_value");
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
SetLocale(String)
Sets the locale.
Declaration
public AssetLibrary SetLocale(string Locale)
Parameters
Type | Name | Description |
---|---|---|
System.String | Locale | Locale. |
Returns
Type | Description |
---|---|
AssetLibrary | The locale. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.SetLocale("en-us");
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
Skip(Int32)
The number of objects to skip before returning any.
Declaration
public AssetLibrary Skip(int number)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | number | No of objects to skip from returned objects. |
Returns
Type | Description |
---|---|
AssetLibrary | Current instance of AssetLibrary, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.Skip(2);
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();
|
Improve this Doc
View Source
SortWithKeyAndOrderBy(String, OrderBy)
Sorts the assets in the given order on the basis of the specified field.
Declaration
public void SortWithKeyAndOrderBy(string key, OrderBy order)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key. |
Contentstack.Core.Internals.OrderBy | order | Order. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
AssetLibrary assetLibrary = stack.AssetLibrary();
assetLibrary.SortWithKeyAndOrderBy("custom_key", "custom_value");
ContentstackCollection>Asset< contentstackCollection = await assetLibrary.FetchAll();