public async Task <RemoveDomainWhitelistResponse> Remove(RemoveDomainWhitelistRequest request, AdminKey adminKey = null, HttpClient httpClient = null) { using (var api = new GetAddesssApi(adminKey ?? AdminKey, HttpClient ?? httpClient)) { return(await api.DomainWhitelist.Remove(request)); } }
public async static Task <RemoveDomainWhitelistResponse> Remove(GetAddesssApi api, RemoveDomainWhitelistRequest 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 RemoveDomainWhitelistResponse.Success((int)response.StatusCode, response.ReasonPhrase, body, message)); } return(new RemoveDomainWhitelistResponse.Failed((int)response.StatusCode, response.ReasonPhrase, body)); }
public async Task <RemoveDomainWhitelistResponse> Remove(RemoveDomainWhitelistRequest request) { return(await Remove(Api, request, Path, AdminKey)); }