public async Task <UpdateSubaccountResponse> Update(SubaccountUpdate subaccount) { var request = new Request { Url = $"api/{client.Version}/subaccounts/{subaccount.Id}", Method = "PUT JSON", Data = new { name = subaccount.Name, status = subaccount.Status.ToString().ToLowerInvariant() } }; var response = await requestSender.Send(request); if (response.StatusCode != HttpStatusCode.OK) { throw new ResponseException(response); } var results = Jsonification.DeserializeObject <dynamic>(response.Content).results; return(new UpdateSubaccountResponse { ReasonPhrase = response.ReasonPhrase, StatusCode = response.StatusCode, Content = response.Content }); }
public async Task<UpdateSubaccountResponse> Update(SubaccountUpdate subaccount) { var request = new Request { Url = $"api/{client.Version}/subaccounts/{subaccount.Id}", Method = "PUT JSON", Data = new { name = subaccount.Name, status = subaccount.Status.ToString().ToLowerInvariant() } }; var response = await requestSender.Send(request); if (response.StatusCode != HttpStatusCode.OK) throw new ResponseException(response); var results = Jsonification.DeserializeObject<dynamic>(response.Content).results; return new UpdateSubaccountResponse { ReasonPhrase = response.ReasonPhrase, StatusCode = response.StatusCode, Content = response.Content }; }