/// <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 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); }
/// <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 the links for work item revision. /// </summary> /// <typeparam name="TLinkCollection">The type of the t link collection.</typeparam> /// <param name="id">The identifier.</param> /// <param name="rev">The rev.</param> /// <param name="fromToken">From token.</param> /// <returns>Task<TLinkCollection>.</returns> public async Task <TLinkCollection> GetLinksForWorkItemRevision <TLinkCollection>(int id, int rev, Func <JArray, TLinkCollection> fromToken) where TLinkCollection : JsonLinkCollection { var exchange = StructuredHttpExchange.Get(WitRestCalls.Revision); exchange.SetRoute("{id}", id); exchange.SetRoute("{revisionNumber}", rev); exchange.SetQuery("$expand", "relations"); TLinkCollection result = await ProcessCollectionRequest(exchange, o => { JProperty rootToken = o.Properties().FirstOrDefault(p => p.Name == "relations"); JArray values; if (rootToken != null) { values = (JArray)rootToken.Value; } else { values = new JArray(); } TLinkCollection collection = JsonParsers.JArrayToInstance(values, fromToken); return(collection); }); 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 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 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 team rooms. /// </summary> /// <returns>Task<IList<ITeamRoom>>.</returns> public async Task <IReadOnlyList <ITeamRoom> > GetTeamRooms() { var exchange = StructuredHttpExchange.Get("/chat/rooms"); IReadOnlyList <ITeamRoom> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, TeamRoomImpl.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 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); }
/// <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 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); }
/// <summary> /// Gets the fields. /// </summary> /// <returns>Task<IList<JsonFieldDefinition>>.</returns> public async Task <IReadOnlyList <JsonFieldDefinition> > GetFieldDefinitions() { var exchange = StructuredHttpExchange.Get(WitRestCalls.FieldDefinitions); IReadOnlyList <JsonFieldDefinition> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonFieldDefinition.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 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 <JsonBuildQuality> > GetQualities(string project) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(BuildRestCalls.Qualities); IReadOnlyList <JsonBuildQuality> result = await ProcessProjectRequest(project, exchange, o => JsonParsers.JArrayToObjects(o["value"].Value <JArray>(), JsonBuildQuality.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 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 <JsonBuildDefinition> GetDefinition(string project, int definitionId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(BuildRestCalls.Definition); exchange.SetRoute("{definitionId}", definitionId); JsonBuildDefinition result = await ProcessProjectRequest(project, exchange, JsonBuildDefinition.FromToken); return(result); }
/// <summary> /// Gets the project teams. /// </summary> /// <param name="projectId">The project identifier.</param> /// <returns>Task<IReadOnlyList<JsonProjectTeam>>.</returns> public async Task <IReadOnlyList <JsonProjectTeam> > GetProjectTeams(Guid projectId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(ProjectRestCalls.ProjectTeams); exchange.SetRoute("{projectId}", projectId); IReadOnlyList <JsonProjectTeam> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonProjectTeam.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); }
public async Task <JsonBuildQueue> GetQueue(int queueId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(BuildRestCalls.Queue); exchange.SetRoute("{queueId}", queueId); JsonBuildQueue result = await ProcessCollectionRequest(exchange, JsonBuildQueue.FromToken); return(result); }
public async Task <JsonBuildQuality> GetQuality(string project, int qualityId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(BuildRestCalls.Quality); exchange.SetRoute("{qualityId}", qualityId); JsonBuildQuality result = await ProcessProjectRequest(project, exchange, JsonBuildQuality.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 project. /// </summary> /// <param name="projectName">Name of the project.</param> /// <returns>Task<JsonProject>.</returns> public async Task <JsonProject> GetProject(string projectName) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(ProjectRestCalls.ProjectByName); exchange.SetRoute("{projectName}", projectName); JsonProject result = await ProcessCollectionRequest(exchange, JsonProject.FromToken); return(result); }
public async Task <JsonBuild> GetBuild(string project, int buildId) { StructuredHttpExchange exchange = StructuredHttpExchange.Get(BuildRestCalls.Build); exchange.SetRoute("{buildId}", buildId); JsonBuild result = await ProcessProjectRequest(project, exchange, JsonBuild.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); }
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 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 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); }