Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Bynder SDK to exclude meta property options, due to request ti… #1

Merged
merged 1 commit into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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