Skip to content

Commit 2172f1c

Browse files
authored
Merge pull request #72 from contentstack/staging
DX | 14-11-2024 | Release
2 parents 0f227ec + eff9b9e commit 2172f1c

File tree

6 files changed

+75
-3
lines changed

6 files changed

+75
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### Version: 2.18.0
2+
#### Date: Nov-18-2024
3+
4+
##### Feat:
5+
- Added support to access different properties of asset
6+
17
### Version: 2.17.0
28
#### Date: Oct-21-2024
39

Contentstack.AspNetCore/Contentstack.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
<PackageReference Include="NuGet.Build.Packaging" Version="0.2.2"><PrivateAssets>all</PrivateAssets>
3232
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3333
</PackageReference>
34-
<PackageReference Include="contentstack.csharp" Version="2.15.0" />
34+
<PackageReference Include="contentstack.csharp" Version="2.17.0" />
3535
</ItemGroup>
3636
</Project>

Contentstack.Core.Tests/AssetTest.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ await asset.Fetch().ContinueWith((t) =>
4040
});
4141
}
4242

43+
[Fact]
44+
public async Task FetchAssetToAccessAttributes()
45+
{
46+
string uid = await FetchAssetUID();
47+
Asset a1 = await client.Asset(uid).AddParam("include_dimension", "true").Fetch();
48+
Assert.NotEmpty(a1.Url);
49+
Assert.NotEmpty(a1.ContentType);
50+
Assert.NotEmpty(a1.Version);
51+
Assert.NotEmpty(a1.FileSize);
52+
Assert.NotEmpty(a1.FileName);
53+
Assert.NotEmpty(a1.Description);
54+
Assert.NotEmpty(a1.UpdatedBy);
55+
Assert.NotEmpty(a1.CreatedBy);
56+
Assert.NotEmpty(a1.PublishDetails);
57+
}
58+
4359
[Fact]
4460
public async Task FetchAssetsPublishFallback()
4561
{

Contentstack.Core/Internals/HttpRequestHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public async Task<string> ProcessRequest(string Url, Dictionary<string, object>
4848
var request = (HttpWebRequest)WebRequest.Create(uri);
4949
request.Method = "GET";
5050
request.ContentType = "application/json";
51-
request.Headers["x-user-agent"]="contentstack-delivery-dotnet/2.17.0";
51+
request.Headers["x-user-agent"]="contentstack-delivery-dotnet/2.18.0";
5252
request.Timeout = timeout;
5353

5454
if (proxy != null)

Contentstack.Core/Models/Asset.cs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public string Url
110110
/// <summary>
111111
/// The original name of the file.
112112
/// </summary>
113+
[JsonProperty(PropertyName = "filename")]
113114
public string FileName { get; set; }
114115

115116
/// <summary>
@@ -122,6 +123,55 @@ public string Url
122123
/// </summary>
123124
public Object[] Tags { get; set; }
124125

126+
/// <summary>
127+
/// This content_type in asset.
128+
/// </summary>
129+
[JsonProperty(propertyName: "content_type")]
130+
public string ContentType { get; set; }
131+
132+
/// <summary>
133+
/// This for whether it is asset directory
134+
/// </summary>
135+
[JsonProperty(propertyName: "is_dir")]
136+
public Boolean IsDir { get; set; }
137+
138+
/// <summary>
139+
/// Uid of user who updated the file
140+
/// </summary>
141+
[JsonProperty(PropertyName = "updated_by")]
142+
public string UpdatedBy { get; set; }
143+
144+
/// <summary>
145+
/// Uid of user who updated the file
146+
/// </summary>
147+
[JsonProperty(PropertyName = "created_by")]
148+
public string CreatedBy { get; set; }
149+
150+
151+
/// <summary>
152+
/// The Uid of folder in which the asset is present
153+
/// </summary>
154+
[JsonProperty(PropertyName = "parent_uid")]
155+
public string ParentUid { get; set; }
156+
157+
/// <summary>
158+
/// The Version of Asset
159+
/// </summary>
160+
[JsonProperty(PropertyName = "_version")]
161+
public string Version { get; set; }
162+
163+
/// <summary>
164+
/// Dimension Object of the asset containing Height and width
165+
/// </summary>
166+
[JsonProperty(PropertyName = "dimension")]
167+
public Dictionary<string, object> Dimension { get; set; }
168+
169+
/// <summary>
170+
/// Dimension Object of the asset containing Height and width
171+
/// </summary>
172+
[JsonProperty(PropertyName = "publish_details")]
173+
public Dictionary<string, object> PublishDetails { get; set; }
174+
125175
#region Internal Constructors
126176
internal Asset(ContentstackClient stack, string uid)
127177
{

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>2.17.0</Version>
3+
<Version>2.18.0</Version>
44
</PropertyGroup>
55
</Project>

0 commit comments

Comments
 (0)