private async Task <TResponse> GetInternalAsync <TResponse>(IVstsRequest <TResponse> request) { return(await new Url(request.BaseUri(_organization)) .AllowHttpStatus(HttpStatusCode.NotFound) .AppendPathSegment(request.Resource) .SetQueryParams(request.QueryParams) .WithBasicAuth(string.Empty, _token) .GetJsonAsync <TResponse>() .ConfigureAwait(false)); }
private async Task <TResponse> PutInternalAsync <TInput, TResponse>(IVstsRequest <TInput, TResponse> request, TInput body) { return(await new Url(request.BaseUri(_organization)) .AppendPathSegment(request.Resource) .WithBasicAuth(string.Empty, _token) .SetQueryParams(request.QueryParams) .PutJsonAsync(body) .ReceiveJson <TResponse>() .ConfigureAwait(false)); }
private async Task DeleteInternalAsync(IVstsRequest request) { (await new Url(request.BaseUri(_organization)) .AppendPathSegment(request.Resource) .WithBasicAuth(string.Empty, _token) .SetQueryParams(request.QueryParams) .DeleteAsync() .ConfigureAwait(false)) .Dispose(); }
public Uri BaseUri(string organization) => _request.BaseUri(organization);