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