public async Task <RemoveFirstLimitReachedWebhookResponse> Remove(RemoveFirstLimitReachedWebhookRequest request) { return(await Remove(Api, request, Path, AdminKey)); }
public async static Task <RemoveFirstLimitReachedWebhookResponse> Remove(GetAddesssApi api, RemoveFirstLimitReachedWebhookRequest request, string path, AdminKey adminKey) { if (api == null) { throw new ArgumentNullException(nameof(api)); } if (request == null) { throw new ArgumentNullException(nameof(request)); } if (path == null) { throw new ArgumentNullException(nameof(path)); } var fullPath = path + request.Id; api.SetAuthorizationKey(adminKey); var response = await api.Delete(fullPath); var body = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { var message = GetMessage(body); return(new RemoveFirstLimitReachedWebhookResponse.Success((int)response.StatusCode, response.ReasonPhrase, body, message)); } return(new RemoveFirstLimitReachedWebhookResponse.Failed((int)response.StatusCode, response.ReasonPhrase, body)); }
public async static Task <RemoveFirstLimitReachedWebhookResponse> Remove(GetAddesssApi api, RemoveFirstLimitReachedWebhookRequest request, string path, AdminKey adminKey) { var result = await Remove(api, new RemoveWebhookRequest(request.Id), path, adminKey); return(result.FormerResult()); }