Skip to content

Commit

Permalink
Merge pull request #1 from smintio/bugfix/get-metaproperties
Browse files Browse the repository at this point in the history
Extend Bynder SDK to exclude meta property options, due to request ti…
  • Loading branch information
rh78 authored Mar 21, 2022
2 parents 1323c1f + fe217f6 commit 8449ae3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Bynder/Sdk/Service/Asset/AssetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@ public async Task<IList<Brand>> GetBrandsAsync()
/// Check <see cref="IAssetService"/> for more information
/// </summary>
/// <returns>Check <see cref="IAssetService"/> for more information</returns>
public async Task<IDictionary<string, Metaproperty>> GetMetapropertiesAsync()
public async Task<IDictionary<string, Metaproperty>> GetMetapropertiesAsync(bool includeOptions)
{
var path = includeOptions
? "/api/v4/metaproperties/"
: "/api/v4/metaproperties/?options=0";

return await _requestSender.SendRequestAsync(new ApiRequest<IDictionary<string, Metaproperty>>
{
Path = "/api/v4/metaproperties/",
Path = path,
HTTPMethod = HttpMethod.Get,
}).ConfigureAwait(false);
}
Expand Down
3 changes: 2 additions & 1 deletion Bynder/Sdk/Service/Asset/IAssetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ public interface IAssetService
/// Gets a dictionary of the metaproperties async. The key of the dictionary
/// returned is the name of the metaproperty.
/// </summary>
/// <param name="query">information whether to include methoproperties options</param>
/// <returns>Task with dictionary of metaproperties</returns>
/// <exception cref="HttpRequestException">Can be thrown when requests to server can't be completed or HTTP code returned by server is an error</exception>
Task<IDictionary<string, Metaproperty>> GetMetapropertiesAsync();
Task<IDictionary<string, Metaproperty>> GetMetapropertiesAsync(bool includeOptions);

/// <summary>
/// Retrieve specific Metaproperty
Expand Down

0 comments on commit 8449ae3

Please sign in to comment.