/// <summary> /// Get the history of subscription updates you've made to a user. /// </summary> public async Task <GetHistoryOfUserResponseModel> GetHistoryOfUserAsync(GetHistoryOfUserRequestModel model) { try { if (string.IsNullOrEmpty(model.UserId) && string.IsNullOrEmpty(model.UserAlias)) { throw new MissingMemberException("Either you need to set 'UserId' or 'UserAlias'"); } var result = await client.GetAsync("v2/users/" + (string.IsNullOrEmpty(model.UserAlias) ? model.UserId : model.UserAlias) + "/"); var jsonResponse = await result.Content.ReadAsStringAsync(); var history = Newtonsoft.Json.JsonConvert.DeserializeObject <List <UserHistoryData> >(jsonResponse); var response = new GetHistoryOfUserResponseModel { History = history }; response.IsSuccessfull = result.IsSuccessStatusCode; return(response); } catch (Exception e) { throw e; } }
/// <summary> /// Get the history of subscription updates you've made to a user. /// </summary> public GetHistoryOfUserResponseModel GetHistoryOfUser(GetHistoryOfUserRequestModel model) => GetHistoryOfUserAsync(model).ConfigureAwait(false).GetAwaiter().GetResult();