From fe217f6af0fbcca125b0c1af43a47710ab355298 Mon Sep 17 00:00:00 2001 From: Yosif Velev Date: Mon, 21 Mar 2022 16:39:46 +0200 Subject: [PATCH] Extend Bynder SDK to exclude meta property options, due to request timeout. --- Bynder/Sdk/Service/Asset/AssetService.cs | 8 ++++++-- Bynder/Sdk/Service/Asset/IAssetService.cs | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Bynder/Sdk/Service/Asset/AssetService.cs b/Bynder/Sdk/Service/Asset/AssetService.cs index 1ce3b94..33e5348 100644 --- a/Bynder/Sdk/Service/Asset/AssetService.cs +++ b/Bynder/Sdk/Service/Asset/AssetService.cs @@ -56,11 +56,15 @@ public async Task> GetBrandsAsync() /// Check for more information /// /// Check for more information - public async Task> GetMetapropertiesAsync() + public async Task> GetMetapropertiesAsync(bool includeOptions) { + var path = includeOptions + ? "/api/v4/metaproperties/" + : "/api/v4/metaproperties/?options=0"; + return await _requestSender.SendRequestAsync(new ApiRequest> { - Path = "/api/v4/metaproperties/", + Path = path, HTTPMethod = HttpMethod.Get, }).ConfigureAwait(false); } diff --git a/Bynder/Sdk/Service/Asset/IAssetService.cs b/Bynder/Sdk/Service/Asset/IAssetService.cs index d217ebd..d83d2a3 100644 --- a/Bynder/Sdk/Service/Asset/IAssetService.cs +++ b/Bynder/Sdk/Service/Asset/IAssetService.cs @@ -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. /// + /// information whether to include methoproperties options /// Task with dictionary of metaproperties /// Can be thrown when requests to server can't be completed or HTTP code returned by server is an error - Task> GetMetapropertiesAsync(); + Task> GetMetapropertiesAsync(bool includeOptions); /// /// Retrieve specific Metaproperty