public async static Task <BillingAddressResponse> Update(GetAddesssApi api, BillingAddressRequest request, string path, AdminKey adminKey) { if (api == null) { throw new ArgumentNullException(nameof(api)); } if (request == null) { throw new ArgumentNullException(nameof(request)); } api.SetAuthorizationKey(adminKey); var response = await api.Put(path, request); var body = await response.Content.ReadAsStringAsync(); if (response.IsSuccessStatusCode) { var address = GetBillingAddress(body); return(new BillingAddressResponse.Success((int)response.StatusCode, response.ReasonPhrase, body, address.Line1, address.Line2, address.Line3, address.TownOrCity, address.County, address.Postcode)); } return(new BillingAddressResponse.Failed((int)response.StatusCode, response.ReasonPhrase, body)); }
public async Task<BillingAddressResponse> Update(BillingAddressRequest request, AdminKey adminKey = null, HttpClient httpClient = null) { using (var api = new GetAddesssApi(adminKey ?? AdminKey, HttpClient ?? httpClient)) { return await api.BillingAddress.Update(request); } }
public async Task <BillingAddressResponse> Update(BillingAddressRequest request) { return(await Update(Api, request, Path, AdminKey)); }