public async Task <IReadOnlyList <T> > GetWorkItemRevisions <T>(int id, Func <JToken, T> func) { var exchange = StructuredHttpExchange.Get(WitRestCalls.Revisions); exchange.SetRoute("{id}", id); IReadOnlyList <T> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, func)); return(result); }
/// <summary> /// Gets the work item as JsonWorkItem. This is used privately to allow for manipulations /// that would not be feasible (without casting) using the JsonWorkItem interface. /// </summary> /// <param name="ids">The ids.</param> /// <param name="func"></param> /// <returns>Task<IReadOnlyList<JsonWorkItem>>.</returns> private async Task <IReadOnlyList <T> > JsonWorkItemsLoader <T>(IEnumerable <int> ids, Func <JToken, T> func) where T : JsonWorkItem { var exchange = StructuredHttpExchange.Get(WitRestCalls.WorkItems); exchange.SetQuery("ids", ToCommaList(ids)); IReadOnlyList <T> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, func)); return(result); }
/// <summary> /// Gets the work item type categories. /// </summary> /// <param name="project">The project.</param> /// <returns>Task<IList<JsonCategory>>.</returns> public async Task <IReadOnlyList <JsonWorkItemTypeCategory> > GetWorkItemTypeCategories(string project) { var exchange = StructuredHttpExchange.Get(WitRestCalls.WorkItemTypeCategories); IReadOnlyList <JsonWorkItemTypeCategory> result = await ProcessProjectRequest(project, exchange, o => JsonParsers.ValuesToObjects(o, JsonWorkItemTypeCategory.FromToken)); return(result); }
/// <summary> /// Gets the members. /// </summary> /// <param name="projectId">The project identifier.</param> /// <param name="teamId">The team identifier.</param> /// <returns>Task<IReadOnlyList<JsonIdentity>>.</returns> public async Task <IReadOnlyList <JsonIdentity> > GetMembers(string projectId, string teamId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(CoreRestCalls.Members); exchange.SetRoute("{projectId}", projectId); exchange.SetRoute("{teamId}", teamId); IReadOnlyList <JsonIdentity> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonIdentity.FromToken)); return(result); }
/// <summary> /// Gets the details. /// </summary> /// <returns>Task<IReadOnlyList<JsonGeneralPurposeObject>>.</returns> public async Task <IReadOnlyList <JsonGeneralPurposeObject> > GetDetails() { StructuredHttpExchange exchange = StructuredHttpExchange.Get(CoreRestCalls.ConnectedServices); IReadOnlyList <JsonGeneralPurposeObject> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonGeneralPurposeObject.FromToken)); return(result); }
/// <summary> /// Gets the teams. /// </summary> /// <param name="projectId">The project identifier.</param> /// <returns>Task<IReadOnlyList<JsonGeneralPurposeObject>>.</returns> public async Task <IReadOnlyList <JsonTeam> > GetTeams(string projectId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(CoreRestCalls.Teams); exchange.SetRoute("{projectId}", projectId); exchange.SetRoute("{*teamId}", String.Empty); IReadOnlyList <JsonTeam> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonTeam.FromToken)); return(result); }
public async Task <IReadOnlyList <JsonGeneralPurposeObject> > GetBacklogs() { var exchange = StructuredHttpExchange.Get(AgileRestCalls.Backlogs); IReadOnlyList <JsonGeneralPurposeObject> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonGeneralPurposeObject.FromToken)); return(result); }
/// <summary> /// Gets the summaries. /// </summary> /// <returns>Task<IReadOnlyList<JsonGeneralPurposeObject>>.</returns> public async Task <IReadOnlyList <JsonGeneralPurposeObject> > GetSummaries() { StructuredHttpExchange exchange = StructuredHttpExchange.Get(CodelensRestCalls.Filesummaries); IReadOnlyList <JsonGeneralPurposeObject> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonGeneralPurposeObject.FromToken)); return(result); }
/// <summary> /// Gets the changesets. /// </summary> /// <returns>Task<IReadOnlyList<JsonGeneralPurposeObject>>.</returns> public async Task <IReadOnlyList <JsonChangeSet> > GetChangesets() { StructuredHttpExchange exchange = StructuredHttpExchange.Get(TfvcRestCalls.Changesets); IReadOnlyList <JsonChangeSet> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonChangeSet.FromToken)); return(result); }
public async Task <IReadOnlyList <JsonAvailableRestCall> > GetAvailableRestCalls() { var exchange = StructuredHttpExchange.Options(""); IReadOnlyList <JsonAvailableRestCall> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonAvailableRestCall.FromToken)); return(result); }
/// <summary> /// Gets the users. /// </summary> /// <param name="roomId">The room identifier.</param> /// <returns>Task<IReadOnlyList<JsonRoomMember>>.</returns> public async Task <IReadOnlyList <JsonRoomMember> > GetUsers(string roomId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(ChatRestCalls.Users); exchange.SetRoute("{roomId}", roomId); IReadOnlyList <JsonRoomMember> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonRoomMember.FromToken)); return(result); }
public async Task <IReadOnlyList <JsonQueryBase> > GetQueries(string project) { var exchange = StructuredHttpExchange.Get(WitRestCalls.AllProjectQueries); exchange.SetQuery("$depth", 1); IReadOnlyList <JsonQueryBase> results = await ProcessProjectRequest(project, exchange, o => JsonParsers.ValuesToObjects(o, JsonQueryBase.FromToken)); foreach (var item in results) { var asFolder = item as JsonQueryFolder; if (asFolder != null) { foreach (var child in asFolder.Children) { if (child.IsFolder) { await GetChildQueries(project, child as JsonQueryFolder); } } } } return(results); }
private async Task <IReadOnlyList <T> > JsonWorkItemsLoader <T>(List <int> ids, DateTime timeStamp, Func <JToken, T> func) where T : JsonWorkItem { var lists = SplitList(ids, 190); var retVal = new List <T>(); foreach (var list in lists) { var exchange = StructuredHttpExchange.Get(WitRestCalls.WorkItems); exchange.SetQuery("ids", ToCommaList(list)); exchange.SetQuery("fields", "System.Title"); exchange.SetQuery("asOf", timeStamp.ToString("o")); IReadOnlyList <T> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, func)); retVal.AddRange(result); } return(retVal); }
/// <summary> /// Gets the work item types. /// </summary> /// <typeparam name="TWorkItemType">The type of the t work item type.</typeparam> /// <param name="project">The project.</param> /// <param name="fromToken">From token.</param> /// <returns>Task<IReadOnlyDictionary<System.String, TWorkItemType>>.</returns> public async Task <IReadOnlyDictionary <string, TWorkItemType> > GetWorkItemTypes <TWorkItemType>(string project, Func <JToken, TWorkItemType> fromToken) where TWorkItemType : JsonWorkItemType { var exchange = StructuredHttpExchange.Get(WitRestCalls.WorkItemTypes); IReadOnlyList <TWorkItemType> result = await ProcessProjectRequest(project, exchange, o => JsonParsers.ValuesToObjects(o, fromToken)); return((IReadOnlyDictionary <string, TWorkItemType>)result.ToDictionary(entry => entry.Name)); }
/// <summary> /// Gets all project information. /// </summary> /// <returns>Task<IReadOnlyList<JsonProjectInfo>>.</returns> public async Task <IReadOnlyList <JsonProjectInfo> > GetAllProjectInfo() { StructuredHttpExchange exchange = StructuredHttpExchange.Get(TfvcRestCalls.AllProjectInfo); IReadOnlyList <JsonProjectInfo> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonProjectInfo.FromToken)); return(result); }
public async Task <IReadOnlyList <JsonBuildDetails> > GetBuildDetails(string project, int buildId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(BuildRestCalls.BuildDetails); exchange.SetRoute("{buildId}", buildId); IReadOnlyList <JsonBuildDetails> result = await ProcessProjectRequest(project, exchange, o => JsonParsers.ValuesToObjects(o, JsonBuildDetails.FromToken)); return(result); }
/// <summary> /// Gets the changeset work items. /// </summary> /// <param name="changeSetId">The change set identifier.</param> /// <returns>Task<IReadOnlyList<JsonGeneralPurposeObject>>.</returns> public async Task <IReadOnlyList <JsonGeneralPurposeObject> > GetChangesetWorkItems(int changeSetId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(TfvcRestCalls.ChangesetWorkItems); exchange.SetRoute("{id}", changeSetId); IReadOnlyList <JsonGeneralPurposeObject> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonGeneralPurposeObject.FromToken)); return(result); }
public async Task <IReadOnlyList <JsonBuildRequest> > GetRequests(string project) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(BuildRestCalls.Requests); IReadOnlyList <JsonBuildRequest> result = await ProcessProjectRequest(project, exchange, o => JsonParsers.ValuesToObjects(o, JsonBuildRequest.FromToken)); return(result); }
/// <summary> /// Gets the changesets batch. /// </summary> /// <param name="ids">The ids.</param> /// <returns>Task<IReadOnlyList<JsonChangeSet>>.</returns> public async Task <IReadOnlyList <JsonChangeSet> > GetChangesetsBatch(List <int> ids) { var json = new JObject(); var array = new JArray(); foreach (int id in ids) { array.Add(id); } json.Add("changesetIds", array); json.Add("commentLength", 255); string body = json.ToString(); StructuredHttpExchange exchange = StructuredHttpExchange.Post(TfvcRestCalls.ChangesetsBatch, body); IReadOnlyList <JsonChangeSet> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonChangeSet.FromToken)); return(result); }
/// <summary> /// Gets the item batch. /// </summary> /// <returns>Task<IReadOnlyList<JsonGeneralPurposeObject>>.</returns> public async Task <IReadOnlyList <JsonGeneralPurposeObject> > GetItemBatch() { StructuredHttpExchange exchange = StructuredHttpExchange.Get(TfvcRestCalls.ItemBatch); IReadOnlyList <JsonGeneralPurposeObject> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonGeneralPurposeObject.FromToken)); return(result); }
public async Task <IReadOnlyList <TProject> > GetProjects <TProject>(Func <JToken, TProject> fromToken) where TProject : JsonProject { var exchange = StructuredHttpExchange.Get("/projects/"); IReadOnlyList <TProject> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, fromToken)); return(result); }
/// <summary> /// Gets the items. /// </summary> /// <returns>Task<IReadOnlyList<JsonGeneralPurposeObject>>.</returns> public async Task <IReadOnlyList <JsonVersionControlItem> > GetItems() { StructuredHttpExchange exchange = StructuredHttpExchange.Get(TfvcRestCalls.Items); IReadOnlyList <JsonVersionControlItem> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonVersionControlItem.FromToken)); return(result); }
/// <summary> /// Gets the project team members. /// </summary> /// <param name="projectId">The project identifier.</param> /// <param name="teamId">The team identifier.</param> /// <returns>Task<IReadOnlyList<JsonProjectTeamMember>>.</returns> public async Task <IReadOnlyList <JsonProjectTeamMember> > GetProjectTeamMembers(Guid projectId, Guid teamId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(ProjectRestCalls.ProjectTeamMembers); exchange.SetRoute("{projectId}", projectId); exchange.SetRoute("{teamId}", teamId); IReadOnlyList <JsonProjectTeamMember> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonProjectTeamMember.FromToken)); return(result); }
/// <summary> /// Gets the label items. /// </summary> /// <param name="labelId">The label identifier.</param> /// <returns>Task<IReadOnlyList<JsonTfvcLabelItem>>.</returns> public async Task <IReadOnlyList <JsonTfvcLabelItem> > GetLabelItems(int labelId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(TfvcRestCalls.LabelItems); exchange.SetRoute("{labelId}", labelId); IReadOnlyList <JsonTfvcLabelItem> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonTfvcLabelItem.FromToken)); return(result); }
/// <summary> /// Gets the connected services. /// </summary> /// <param name="projectId">The project identifier.</param> /// <returns>Task<IReadOnlyList<JsonGeneralPurposeObject>>.</returns> public async Task <IReadOnlyList <JsonGeneralPurposeObject> > GetConnectedServices(string projectId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(CoreRestCalls.ConnectedServices); exchange.SetRoute("{projectId}", projectId); exchange.SetRoute("{name}", String.Empty); IReadOnlyList <JsonGeneralPurposeObject> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonGeneralPurposeObject.FromToken)); return(result); }
/// <summary> /// Gets the project specific information. /// </summary> /// <param name="project">The project.</param> /// <returns>Task<IReadOnlyList<JsonProjectInfo>>.</returns> public async Task <IReadOnlyList <JsonProjectInfo> > GetProjectSpecificInfo(string project) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(TfvcRestCalls.ProjectSpecificInfo); exchange.SetRoute("{projectId}", project); IReadOnlyList <JsonProjectInfo> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonProjectInfo.FromToken)); return(result); }
/// <summary> /// Gets the identity MRU. /// </summary> /// <returns>Task<IReadOnlyList<JsonGeneralPurposeObject>>.</returns> public async Task <IReadOnlyList <JsonGeneralPurposeObject> > GetIdentityMru() { StructuredHttpExchange exchange = StructuredHttpExchange.Get(CoreRestCalls.IdentityMru); exchange.SetRoute("{mruName}", String.Empty); IReadOnlyList <JsonGeneralPurposeObject> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonGeneralPurposeObject.FromToken)); return(result); }
/// <summary> /// Gets the shelveset work items. /// </summary> /// <param name="shelvesetId">The shelveset identifier.</param> /// <returns>Task<IReadOnlyList<JsonWorkItem>>.</returns> public async Task <IReadOnlyList <JsonWorkItem> > GetShelvesetWorkItems(string shelvesetId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(TfvcRestCalls.ShelvesetWorkItems); exchange.SetRoute("{shelvesetId}", shelvesetId); IReadOnlyList <JsonWorkItem> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonWorkItem.FromToken)); return(result); }
/// <summary> /// Gets the proxies. /// </summary> /// <returns>Task<IReadOnlyList<JsonGeneralPurposeObject>>.</returns> public async Task <IReadOnlyList <JsonProxy> > GetProxies() { StructuredHttpExchange exchange = StructuredHttpExchange.Get(CoreRestCalls.Proxies); IReadOnlyList <JsonProxy> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonProxy.FromToken)); return(result); }
/// <summary> /// Gets the relation types. /// </summary> /// <returns>Task<IReadOnlyList<IRelationType>>.</returns> public async Task <IReadOnlyList <JsonRelationType> > GetRelationTypes() { var exchange = StructuredHttpExchange.Get(WitRestCalls.WorkItemRelationTypes); IReadOnlyList <JsonRelationType> result = await ProcessCollectionRequest <IReadOnlyList <JsonRelationType> >(exchange, o => JsonParsers.ValuesToObjects(o, JsonRelationType.FromToken)); return(result); }