public RestRequest GetRequest(StashObjectEnum objectType, Dictionary <String, String> parameters, Dictionary <String, String> keys) { if (!_methods.ContainsKey(objectType)) { throw new NotImplementedException(); } return(GetRequest(_methods[objectType], parameters, keys)); }
public T Execute <T>(StashObjectEnum objectType, Dictionary <String, String> parameters = null, Dictionary <String, String> keys = null) where T : new() { IRestResponse <T> response = Client.Execute <T>(GetRequest(objectType, parameters ?? new Dictionary <String, String>(), keys ?? new Dictionary <String, String>())); if (response.ErrorException != null) { throw response.ErrorException; } if (response.ResponseStatus != ResponseStatus.Completed) { throw new Exception(response.ErrorMessage); } return(response.Data); }
protected List <T> GetList <T>(StashObjectEnum objectType, Dictionary <String, String> parameters = null, Dictionary <String, String> keys = null) where T : new() { return(Execute <List <T> >(objectType, parameters, keys)); }