예제 #1
0
        public string GetQueryString(ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var result = new StringBuilder();

            result.AppendQueryStringPart(GetQueryString(queryParameters));
            result.AppendQueryStringPart(GetQueryString(optionalParameters));

            return($"?{result}");
        }
예제 #2
0
        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());
        }
예제 #3
0
        private RestRequest GetRestRequest(string url, ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var queryString = queryStringBuilder.GetQueryString(queryParameters, optionalParameters);

            return(new RestRequest($"{url}/{queryString}", Method.GET));
        }
예제 #4
0
        public ChangeInfo GetDetails(string changeId, ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var restRequest = GetRestRequest($"/changes/{changeId}/detail", queryParameters, optionalParameters);

            return(ExecuteRequest <ChangeInfo>(restRequest));
        }
예제 #5
0
        public List <ChangeInfo> GetAll(ChangeQueryParameters queryParameters, ChangeOptionalParameters optionalParameters)
        {
            var restRequest = GetRestRequest("/changes", queryParameters, optionalParameters);

            return(ExecuteRequest <List <ChangeInfo> >(restRequest));
        }