-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIAzureDevOpsService.cs
More file actions
568 lines (524 loc) · 27.3 KB
/
IAzureDevOpsService.cs
File metadata and controls
568 lines (524 loc) · 27.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
using Viamus.Azure.Devops.Mcp.Server.Models;
namespace Viamus.Azure.Devops.Mcp.Server.Services;
/// <summary>
/// Interface for Azure DevOps operations.
/// </summary>
public interface IAzureDevOpsService
{
/// <summary>
/// Gets a work item by its ID.
/// </summary>
/// <param name="workItemId">The work item ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The work item details.</returns>
Task<WorkItemDto?> GetWorkItemAsync(int workItemId, string? project = null, CancellationToken cancellationToken = default);
/// <summary>
/// Gets multiple work items by their IDs.
/// </summary>
/// <param name="workItemIds">The work item IDs.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of work items.</returns>
Task<IReadOnlyList<WorkItemDto>> GetWorkItemsAsync(IEnumerable<int> workItemIds, string? project = null, CancellationToken cancellationToken = default);
/// <summary>
/// Queries work items using WIQL (Work Item Query Language).
/// </summary>
/// <param name="wiqlQuery">The WIQL query string.</param>
/// <param name="project">The project name (optional).</param>
/// <param name="top">Maximum number of results to return.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of work items matching the query.</returns>
Task<IReadOnlyList<WorkItemDto>> QueryWorkItemsAsync(string wiqlQuery, string? project = null, int top = 200, CancellationToken cancellationToken = default);
/// <summary>
/// Gets child work items of a parent work item.
/// </summary>
/// <param name="parentWorkItemId">The parent work item ID.</param>
/// <param name="project">The project name (optional).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of child work items.</returns>
Task<IReadOnlyList<WorkItemDto>> GetChildWorkItemsAsync(int parentWorkItemId, string? project = null, CancellationToken cancellationToken = default);
/// <summary>
/// Queries work items using WIQL and returns paginated summary results.
/// This is optimized for large result sets with reduced payload size.
/// </summary>
/// <param name="wiqlQuery">The WIQL query string.</param>
/// <param name="project">The project name (optional).</param>
/// <param name="page">Page number (1-based).</param>
/// <param name="pageSize">Number of items per page.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Paginated list of work item summaries.</returns>
Task<PaginatedResult<WorkItemSummaryDto>> QueryWorkItemsSummaryAsync(
string wiqlQuery,
string? project = null,
int page = 1,
int pageSize = 20,
CancellationToken cancellationToken = default);
/// <summary>
/// Adds a comment to a work item.
/// </summary>
/// <param name="workItemId">The work item ID.</param>
/// <param name="comment">The comment text.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The created comment details.</returns>
Task<WorkItemCommentDto> AddWorkItemCommentAsync(
int workItemId,
string comment,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets the comments for a work item, pageable.
/// </summary>
/// <param name="workItemId">The work item ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="top">Maximum number of comments to return per page.</param>
/// <param name="continuationToken">Continuation token from a prior call to fetch the next page.</param>
/// <param name="includeDeleted">Whether to include deleted comments.</param>
/// <param name="order">Sort order: "asc" (oldest first) or "desc" (newest first).</param>
/// <param name="includeRenderedText">If true, expand comments to include rendered HTML text.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>A page of work item comments with pagination metadata.</returns>
Task<WorkItemCommentsResultDto> GetWorkItemCommentsAsync(
int workItemId,
string? project = null,
int? top = null,
string? continuationToken = null,
bool includeDeleted = false,
string? order = null,
bool includeRenderedText = false,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets the attachments linked to a work item.
/// </summary>
/// <param name="workItemId">The work item ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of attachments (filename, size, URL, timestamps).</returns>
Task<IReadOnlyList<WorkItemAttachmentDto>> GetWorkItemAttachmentsAsync(
int workItemId,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Downloads the content of a work item attachment by its ID and returns it inline.
/// </summary>
/// <param name="attachmentId">The attachment GUID (from <see cref="GetWorkItemAttachmentsAsync"/>).</param>
/// <param name="fileName">Optional filename, used in the response.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="maxBytes">Maximum bytes to download (default 10 MB). Larger attachments throw.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Attachment content as UTF-8 text or base64 bytes.</returns>
Task<WorkItemAttachmentContentDto?> GetWorkItemAttachmentContentAsync(
Guid attachmentId,
string? fileName = null,
string? project = null,
long maxBytes = 10 * 1024 * 1024,
CancellationToken cancellationToken = default);
/// <summary>
/// Creates a new work item in the specified project.
/// </summary>
/// <param name="project">The project name.</param>
/// <param name="workItemType">The work item type (e.g., Bug, Task, User Story).</param>
/// <param name="title">The work item title.</param>
/// <param name="description">Optional description.</param>
/// <param name="assignedTo">Optional user to assign to.</param>
/// <param name="areaPath">Optional area path.</param>
/// <param name="iterationPath">Optional iteration path.</param>
/// <param name="state">Optional initial state.</param>
/// <param name="priority">Optional priority (1-4).</param>
/// <param name="parentId">Optional parent work item ID to link as child.</param>
/// <param name="tags">Optional semicolon-separated tags.</param>
/// <param name="additionalFields">Optional dictionary of additional field reference names and values.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The created work item.</returns>
Task<WorkItemDto> CreateWorkItemAsync(
string project,
string workItemType,
string title,
string? description = null,
string? assignedTo = null,
string? areaPath = null,
string? iterationPath = null,
string? state = null,
int? priority = null,
int? parentId = null,
string? tags = null,
Dictionary<string, string>? additionalFields = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Updates an existing work item.
/// </summary>
/// <param name="workItemId">The work item ID to update.</param>
/// <param name="title">Optional new title.</param>
/// <param name="description">Optional new description.</param>
/// <param name="assignedTo">Optional new assignee.</param>
/// <param name="state">Optional new state.</param>
/// <param name="areaPath">Optional new area path.</param>
/// <param name="iterationPath">Optional new iteration path.</param>
/// <param name="priority">Optional new priority (1-4).</param>
/// <param name="tags">Optional new tags.</param>
/// <param name="additionalFields">Optional dictionary of additional field reference names and values.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The updated work item.</returns>
Task<WorkItemDto> UpdateWorkItemAsync(
int workItemId,
string? title = null,
string? description = null,
string? assignedTo = null,
string? state = null,
string? areaPath = null,
string? iterationPath = null,
int? priority = null,
string? tags = null,
Dictionary<string, string>? additionalFields = null,
string? project = null,
CancellationToken cancellationToken = default);
#region Git Operations
/// <summary>
/// Gets all repositories in a project.
/// </summary>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of repositories.</returns>
Task<IReadOnlyList<RepositoryDto>> GetRepositoriesAsync(string? project = null, CancellationToken cancellationToken = default);
/// <summary>
/// Gets a specific repository by name or ID.
/// </summary>
/// <param name="repositoryNameOrId">The repository name or ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The repository details.</returns>
Task<RepositoryDto?> GetRepositoryAsync(string repositoryNameOrId, string? project = null, CancellationToken cancellationToken = default);
/// <summary>
/// Gets all branches in a repository.
/// </summary>
/// <param name="repositoryNameOrId">The repository name or ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of branches.</returns>
Task<IReadOnlyList<BranchDto>> GetBranchesAsync(string repositoryNameOrId, string? project = null, CancellationToken cancellationToken = default);
/// <summary>
/// Gets items (files and folders) at a specific path in a repository.
/// </summary>
/// <param name="repositoryNameOrId">The repository name or ID.</param>
/// <param name="path">The path to browse (default is root "/").</param>
/// <param name="branchName">The branch name (optional, uses default branch if not specified).</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="recursionLevel">How deep to recurse (None, OneLevel, Full). Default is OneLevel.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of git items.</returns>
Task<IReadOnlyList<GitItemDto>> GetItemsAsync(
string repositoryNameOrId,
string path = "/",
string? branchName = null,
string? project = null,
string recursionLevel = "OneLevel",
CancellationToken cancellationToken = default);
/// <summary>
/// Gets the content of a specific file in a repository.
/// </summary>
/// <param name="repositoryNameOrId">The repository name or ID.</param>
/// <param name="filePath">The path to the file.</param>
/// <param name="branchName">The branch name (optional, uses default branch if not specified).</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The file content.</returns>
Task<GitFileContentDto?> GetFileContentAsync(
string repositoryNameOrId,
string filePath,
string? branchName = null,
string? project = null,
CancellationToken cancellationToken = default);
#endregion
#region Pull Request Operations
/// <summary>
/// Gets pull requests for a repository with optional filters.
/// </summary>
/// <param name="repositoryNameOrId">The repository name or ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="status">Filter by status: active, completed, abandoned, or all.</param>
/// <param name="creatorId">Filter by creator's unique name or ID.</param>
/// <param name="reviewerId">Filter by reviewer's unique name or ID.</param>
/// <param name="sourceRefName">Filter by source branch (e.g., refs/heads/feature).</param>
/// <param name="targetRefName">Filter by target branch (e.g., refs/heads/main).</param>
/// <param name="top">Maximum number of results to return.</param>
/// <param name="skip">Number of results to skip for pagination.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of pull requests matching the filters.</returns>
Task<IReadOnlyList<PullRequestDto>> GetPullRequestsAsync(
string repositoryNameOrId,
string? project = null,
string? status = null,
string? creatorId = null,
string? reviewerId = null,
string? sourceRefName = null,
string? targetRefName = null,
int top = 50,
int skip = 0,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets a specific pull request by ID within a repository.
/// </summary>
/// <param name="repositoryNameOrId">The repository name or ID.</param>
/// <param name="pullRequestId">The pull request ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The pull request details.</returns>
Task<PullRequestDto?> GetPullRequestByIdAsync(
string repositoryNameOrId,
int pullRequestId,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets a specific pull request by ID only (project-level lookup, no repository required).
/// </summary>
/// <param name="pullRequestId">The pull request ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The pull request details.</returns>
Task<PullRequestDto?> GetPullRequestByIdOnlyAsync(
int pullRequestId,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets comment threads for a pull request.
/// </summary>
/// <param name="repositoryNameOrId">The repository name or ID.</param>
/// <param name="pullRequestId">The pull request ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of comment threads.</returns>
Task<IReadOnlyList<PullRequestThreadDto>> GetPullRequestThreadsAsync(
string repositoryNameOrId,
int pullRequestId,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Creates a new comment thread on a pull request.
/// </summary>
/// <param name="repositoryNameOrId">The repository name or ID.</param>
/// <param name="pullRequestId">The pull request ID.</param>
/// <param name="content">The initial comment text (Markdown supported).</param>
/// <param name="filePath">Optional file path for an inline thread.</param>
/// <param name="lineNumber">Optional line number for an inline thread.</param>
/// <param name="endLineNumber">Optional ending line number for an inline thread range.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The created comment thread.</returns>
Task<PullRequestThreadDto> CreatePullRequestThreadAsync(
string repositoryNameOrId,
int pullRequestId,
string content,
string? filePath = null,
int? lineNumber = null,
int? endLineNumber = null,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Adds a comment to an existing comment thread on a pull request.
/// </summary>
/// <param name="repositoryNameOrId">The repository name or ID.</param>
/// <param name="pullRequestId">The pull request ID.</param>
/// <param name="threadId">The thread ID to comment on.</param>
/// <param name="content">The comment text (Markdown supported).</param>
/// <param name="parentCommentId">Optional parent comment ID when replying to a specific comment.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The created comment.</returns>
Task<PullRequestCommentDto> AddPullRequestThreadCommentAsync(
string repositoryNameOrId,
int pullRequestId,
int threadId,
string content,
int? parentCommentId = null,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Searches pull requests by title or description.
/// </summary>
/// <param name="repositoryNameOrId">The repository name or ID.</param>
/// <param name="searchText">Text to search for in title or description.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="status">Filter by status: active, completed, abandoned, or all.</param>
/// <param name="top">Maximum number of results to return.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of matching pull requests.</returns>
Task<IReadOnlyList<PullRequestDto>> SearchPullRequestsAsync(
string repositoryNameOrId,
string searchText,
string? project = null,
string? status = null,
int top = 50,
CancellationToken cancellationToken = default);
/// <summary>
/// Creates a new pull request in the specified repository.
/// </summary>
/// <param name="repositoryNameOrId">The repository name or ID.</param>
/// <param name="sourceRefName">The source branch (e.g., refs/heads/feature-branch).</param>
/// <param name="targetRefName">The target branch (e.g., refs/heads/main).</param>
/// <param name="title">The pull request title.</param>
/// <param name="description">Optional pull request description.</param>
/// <param name="isDraft">Whether to create the PR as a draft.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="reviewerIds">Optional reviewer GUIDs.</param>
/// <param name="workItemIds">Optional work item IDs to link.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The created pull request.</returns>
Task<PullRequestDto> CreatePullRequestAsync(
string repositoryNameOrId,
string sourceRefName,
string targetRefName,
string title,
string? description = null,
bool isDraft = false,
string? project = null,
IEnumerable<string>? reviewerIds = null,
IEnumerable<int>? workItemIds = null,
CancellationToken cancellationToken = default);
#endregion
#region Pipeline/Build Operations
/// <summary>
/// Gets all pipelines (build definitions) in a project.
/// </summary>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="name">Optional filter by pipeline name (supports wildcards).</param>
/// <param name="folder">Optional filter by folder path.</param>
/// <param name="top">Maximum number of results to return.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of pipelines.</returns>
Task<IReadOnlyList<PipelineDto>> GetPipelinesAsync(
string? project = null,
string? name = null,
string? folder = null,
int top = 100,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets a specific pipeline by ID.
/// </summary>
/// <param name="pipelineId">The pipeline ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The pipeline details.</returns>
Task<PipelineDto?> GetPipelineAsync(
int pipelineId,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets builds for a project with optional filters.
/// </summary>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="definitions">Optional list of pipeline definition IDs to filter by.</param>
/// <param name="branchName">Optional filter by source branch.</param>
/// <param name="statusFilter">Optional filter by status: all, inProgress, completed, cancelling, postponed, notStarted, none.</param>
/// <param name="resultFilter">Optional filter by result: succeeded, partiallySucceeded, failed, canceled, none.</param>
/// <param name="requestedFor">Optional filter by who requested the build.</param>
/// <param name="top">Maximum number of results to return.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of builds.</returns>
Task<IReadOnlyList<BuildDto>> GetBuildsAsync(
string? project = null,
IEnumerable<int>? definitions = null,
string? branchName = null,
string? statusFilter = null,
string? resultFilter = null,
string? requestedFor = null,
int top = 50,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets a specific build by ID.
/// </summary>
/// <param name="buildId">The build ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The build details.</returns>
Task<BuildDto?> GetBuildAsync(
int buildId,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets the logs for a build.
/// </summary>
/// <param name="buildId">The build ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of build logs.</returns>
Task<IReadOnlyList<BuildLogDto>> GetBuildLogsAsync(
int buildId,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets the content of a specific build log.
/// </summary>
/// <param name="buildId">The build ID.</param>
/// <param name="logId">The log ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The log content as a string.</returns>
Task<string?> GetBuildLogContentAsync(
int buildId,
int logId,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets the timeline (stages, jobs, tasks) for a build.
/// </summary>
/// <param name="buildId">The build ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of timeline records.</returns>
Task<IReadOnlyList<BuildTimelineRecordDto>> GetBuildTimelineAsync(
int buildId,
string? project = null,
CancellationToken cancellationToken = default);
#endregion
#region Wiki Operations
/// <summary>
/// Gets all wikis in a project.
/// </summary>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>List of wikis.</returns>
Task<IReadOnlyList<WikiDto>> GetWikisAsync(string? project = null, CancellationToken cancellationToken = default);
/// <summary>
/// Gets a specific wiki by its identifier (name or ID).
/// </summary>
/// <param name="wikiIdentifier">The wiki name or ID.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The wiki details.</returns>
Task<WikiDto?> GetWikiAsync(string wikiIdentifier, string? project = null, CancellationToken cancellationToken = default);
/// <summary>
/// Gets a wiki page by path, including its content.
/// </summary>
/// <param name="wikiIdentifier">The wiki name or ID.</param>
/// <param name="path">The page path (e.g., "/Home", "/Getting-Started/Installation").</param>
/// <param name="includeContent">Whether to include the page content (Markdown).</param>
/// <param name="version">Optional version/branch of the wiki.</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The wiki page details.</returns>
Task<WikiPageDto?> GetWikiPageAsync(
string wikiIdentifier,
string path,
bool includeContent = true,
string? version = null,
string? project = null,
CancellationToken cancellationToken = default);
/// <summary>
/// Gets the sub-pages of a wiki page (page tree).
/// </summary>
/// <param name="wikiIdentifier">The wiki name or ID.</param>
/// <param name="path">The parent page path (default is root "/").</param>
/// <param name="recursionLevel">How deep to recurse: "OneLevel" or "Full".</param>
/// <param name="project">The project name (optional if default project is configured).</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The wiki page with its sub-pages.</returns>
Task<WikiPageDto?> GetWikiPageTreeAsync(
string wikiIdentifier,
string path = "/",
string recursionLevel = "OneLevel",
string? project = null,
CancellationToken cancellationToken = default);
#endregion
}