コード例 #1
0
ファイル: JsonWitAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        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);
        }
コード例 #2
0
ファイル: JsonWitAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <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&lt;IReadOnlyList&lt;JsonWorkItem&gt;&gt;.</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);
        }
コード例 #3
0
ファイル: JsonWitAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <summary>
        ///     Gets the work item type categories.
        /// </summary>
        /// <param name="project">The project.</param>
        /// <returns>Task&lt;IList&lt;JsonCategory&gt;&gt;.</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);
        }
コード例 #4
0
        /// <summary>
        /// Gets the members.
        /// </summary>
        /// <param name="projectId">The project identifier.</param>
        /// <param name="teamId">The team identifier.</param>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonIdentity&gt;&gt;.</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);
        }
コード例 #5
0
        /// <summary>
        /// Gets the details.
        /// </summary>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonGeneralPurposeObject&gt;&gt;.</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);
        }
コード例 #6
0
        /// <summary>
        /// Gets the teams.
        /// </summary>
        /// <param name="projectId">The project identifier.</param>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonGeneralPurposeObject&gt;&gt;.</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);
        }
コード例 #7
0
ファイル: JsonAgileAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        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);
        }
コード例 #8
0
        /// <summary>
        ///     Gets the summaries.
        /// </summary>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonGeneralPurposeObject&gt;&gt;.</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);
        }
コード例 #9
0
ファイル: JsonTfvcAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <summary>
        ///     Gets the changesets.
        /// </summary>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonGeneralPurposeObject&gt;&gt;.</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);
        }
コード例 #10
0
ファイル: JsonVSOApi.cs プロジェクト: DynConcepts/TfsVsoApi
        public async Task <IReadOnlyList <JsonAvailableRestCall> > GetAvailableRestCalls()
        {
            var exchange = StructuredHttpExchange.Options("");
            IReadOnlyList <JsonAvailableRestCall> result = await ProcessCollectionRequest(exchange, o => JsonParsers.ValuesToObjects(o, JsonAvailableRestCall.FromToken));

            return(result);
        }
コード例 #11
0
        /// <summary>
        /// Gets the users.
        /// </summary>
        /// <param name="roomId">The room identifier.</param>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonRoomMember&gt;&gt;.</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);
        }
コード例 #12
0
ファイル: JsonWitAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        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);
        }
コード例 #13
0
ファイル: JsonWitAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        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);
        }
コード例 #14
0
ファイル: JsonWitAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <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&lt;IReadOnlyDictionary&lt;System.String, TWorkItemType&gt;&gt;.</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));
        }
コード例 #15
0
ファイル: JsonTfvcAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <summary>
        ///     Gets all project information.
        /// </summary>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonProjectInfo&gt;&gt;.</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);
        }
コード例 #16
0
        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);
        }
コード例 #17
0
ファイル: JsonTfvcAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <summary>
        ///     Gets the changeset work items.
        /// </summary>
        /// <param name="changeSetId">The change set identifier.</param>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonGeneralPurposeObject&gt;&gt;.</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);
        }
コード例 #18
0
        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);
        }
コード例 #19
0
ファイル: JsonTfvcAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <summary>
        ///     Gets the changesets batch.
        /// </summary>
        /// <param name="ids">The ids.</param>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonChangeSet&gt;&gt;.</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);
        }
コード例 #20
0
ファイル: JsonTfvcAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <summary>
        ///     Gets the item batch.
        /// </summary>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonGeneralPurposeObject&gt;&gt;.</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);
        }
コード例 #21
0
        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);
        }
コード例 #22
0
ファイル: JsonTfvcAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <summary>
        ///     Gets the items.
        /// </summary>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonGeneralPurposeObject&gt;&gt;.</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);
        }
コード例 #23
0
        /// <summary>
        ///     Gets the project team members.
        /// </summary>
        /// <param name="projectId">The project identifier.</param>
        /// <param name="teamId">The team identifier.</param>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonProjectTeamMember&gt;&gt;.</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);
        }
コード例 #24
0
ファイル: JsonTfvcAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <summary>
        /// Gets the label items.
        /// </summary>
        /// <param name="labelId">The label identifier.</param>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonTfvcLabelItem&gt;&gt;.</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);
        }
コード例 #25
0
        /// <summary>
        /// Gets the connected services.
        /// </summary>
        /// <param name="projectId">The project identifier.</param>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonGeneralPurposeObject&gt;&gt;.</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);
        }
コード例 #26
0
ファイル: JsonTfvcAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <summary>
        ///     Gets the project specific information.
        /// </summary>
        /// <param name="project">The project.</param>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonProjectInfo&gt;&gt;.</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);
        }
コード例 #27
0
        /// <summary>
        /// Gets the identity MRU.
        /// </summary>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonGeneralPurposeObject&gt;&gt;.</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);
        }
コード例 #28
0
ファイル: JsonTfvcAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <summary>
        ///     Gets the shelveset work items.
        /// </summary>
        /// <param name="shelvesetId">The shelveset identifier.</param>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonWorkItem&gt;&gt;.</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);
        }
コード例 #29
0
        /// <summary>
        /// Gets the proxies.
        /// </summary>
        /// <returns>Task&lt;IReadOnlyList&lt;JsonGeneralPurposeObject&gt;&gt;.</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);
        }
コード例 #30
0
ファイル: JsonWitAPI.cs プロジェクト: DynConcepts/TfsVsoApi
        /// <summary>
        ///     Gets the relation types.
        /// </summary>
        /// <returns>Task&lt;IReadOnlyList&lt;IRelationType&gt;&gt;.</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);
        }