public string GetQueryString(ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters) { var result = new StringBuilder(); result.AppendQueryStringPart(GetQueryString(queryParameters)); result.AppendQueryStringPart(GetQueryString(optionalParameters)); return($"?{result}"); }
private static string GetQueryString(ChangeQueryParameters queryParameters) { var result = new StringBuilder(); if (queryParameters.NumberOfResults != 0) { result.AppendQueryStringPart($"n={queryParameters.NumberOfResults}"); } if (queryParameters.Status != null) { result.AppendQueryStringPart($"status:{queryParameters.Status}"); } if (queryParameters.ReviewedByMe) { result.AppendQueryStringPart("q=reviewer:self"); } return(result.ToString()); }
private RestRequest GetRestRequest(string url, ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters) { var queryString = queryStringBuilder.GetQueryString(queryParameters, optionalParameters); return(new RestRequest($"{url}/{queryString}", Method.GET)); }
public ChangeInfo GetDetails(string changeId, ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters) { var restRequest = GetRestRequest($"/changes/{changeId}/detail", queryParameters, optionalParameters); return(ExecuteRequest <ChangeInfo>(restRequest)); }
public List <ChangeInfo> GetAll(ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters) { var restRequest = GetRestRequest("/changes", queryParameters, optionalParameters); return(ExecuteRequest <List <ChangeInfo> >(restRequest)); }