Skip to content

Commit 6468273

Browse files
WIP: Implement Tags including scoped access based on tags
WIP: item tagging WIP: tags WIP: tags
1 parent 488b215 commit 6468273

File tree

16 files changed

+2802
-310
lines changed

16 files changed

+2802
-310
lines changed

src/Certify.Client/CertifyApiClient.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,32 @@ private async Task<HttpResponseMessage> DeleteAsync(string endpoint, AuthContext
313313
}
314314
}
315315

316+
private async Task<HttpResponseMessage> DeleteAsync(string endpoint, object data, AuthContext authContext)
317+
{
318+
using (var request = new HttpRequestMessage(HttpMethod.Delete, new Uri(_baseUri + endpoint)))
319+
{
320+
SetAuthContextForRequest(request, authContext);
321+
322+
if (data != null)
323+
{
324+
var json = JsonConvert.SerializeObject(data);
325+
request.Content = new StringContent(json, System.Text.UnicodeEncoding.UTF8, "application/json");
326+
}
327+
328+
var response = await _client.SendAsync(request).ConfigureAwait(false);
329+
330+
if (response.IsSuccessStatusCode)
331+
{
332+
return response;
333+
}
334+
else
335+
{
336+
var error = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
337+
throw new ServiceCommsException($"Internal Service Error: {endpoint}: {error}");
338+
}
339+
}
340+
}
341+
316342
#region System
317343

318344
public async Task<string> GetAppVersion(AuthContext authContext = null) => await FetchAsync("system/appversion", authContext);
@@ -836,6 +862,7 @@ public async Task<OidcProviderConfig> GetOidcProviderWithSecret(string id, AuthC
836862
}
837863

838864
#endregion
865+
839866
private T JsonToObject<T>(string json)
840867
{
841868
return JsonConvert.DeserializeObject<T>(json);

0 commit comments

Comments
 (0)