Skip to content

Commit 154d013

Browse files
committed
Allow to query assets with counts from Bynder. This API has been missing before.
1 parent 38dc65b commit 154d013

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

Bynder/Sdk/Service/Asset/AssetService.cs

+15
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,21 @@ public async Task<MediaWithTotal> GetMediaWithTotalAsync(MediaWithTotalQuery que
123123
}).ConfigureAwait(false);
124124
}
125125

126+
/// <summary>
127+
/// Check <see cref="IAssetService"/> for more information
128+
/// </summary>
129+
/// <param name="query">Check <see cref="IAssetService"/> for more information</param>
130+
/// <returns>Check <see cref="IAssetService"/> for more information</returns>
131+
public async Task<MediaWithCount> GetMediaWithCountAsync(MediaWithCountQuery query)
132+
{
133+
return await _requestSender.SendRequestAsync(new ApiRequest<MediaWithCount>
134+
{
135+
Path = "/api/v4/media/",
136+
HTTPMethod = HttpMethod.Get,
137+
Query = query,
138+
}).ConfigureAwait(false);
139+
}
140+
126141
/// <summary>
127142
/// Check <see cref="IAssetService"/> for more information
128143
/// </summary>

Bynder/Sdk/Service/Asset/IAssetService.cs

+9
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ public interface IAssetService
8282
/// <exception cref="HttpRequestException">Can be thrown when requests to server can't be completed or HTTP code returned by server is an error</exception>
8383
Task<MediaWithTotal> GetMediaWithTotalAsync(MediaWithTotalQuery query);
8484

85+
/// <summary>
86+
/// Gets a list of media using query information including the individual counts. The media information is not complete, for example
87+
/// media items for media returned are not present. For that client needs to call <see cref="RequestMediaInfoAsync(string)"/>
88+
/// </summary>
89+
/// <param name="query">information to correctly filter/paginate media list</param>
90+
/// <returns>Task with List of media.</returns>
91+
/// <exception cref="HttpRequestException">Can be thrown when requests to server can't be completed or HTTP code returned by server is an error</exception>
92+
Task<MediaWithCount> GetMediaWithCountAsync(MediaWithCountQuery query);
93+
8594
/// <summary>
8695
/// Uploads a file async.
8796
/// </summary>

0 commit comments

Comments
 (0)