Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement continuationToken management (body and headers) on v8.0.0 branch #509

Draft
wants to merge 5 commits into
base: feature/v8.0.0
Choose a base branch
from

Conversation

mnieto
Copy link
Contributor

@mnieto mnieto commented Jan 6, 2023

PR Summary

Some endpoints in Azure DevOps APIs version 6.0 and above use continuationToken as part of the body response or X-MS-ContinuationToken header

In both cases it is possible provide this functionality adding the following parameters to the _callAPI function

  • [string]$UseContinuationToken = 'None' Posible values: None, Header, Body
  • [string]$ContinuationTokenName Allows to specify a header or continuation token property different of the default values. If this parameter is not specified, the default value is X-MS-ContinuationToken or continuationToken depending if $UseHeader is present or not, respectively. Ignored if $UseContinuationToken -eq 'None'
  • [int]$MaxPages = 0 Number of pages to be retrieved. If 0, or not specified, it will return all the available pages. Ignored if $UseContinuationToken -eq 'None'
  • [string]$ColectionPropertyName When using continuationToken, it is neccesary expand a specific property to get the real collection of objects. Ignored if $UseContinuationToken -eq 'None'

IMPORTANT: Managing response headers in the Invoke-RestMethod cmdlet forces to use only poweshell core. This required functionality was introduced in powershell core v6 and it is not available in Desktop flavour.

With this changes it is not necessary to maintain a separated __callAPIContinuationToken function. As part of the PR I want to update the Get-VSTeamUser and Get-VSTeamUserEntitlement functions mentioned in the below issues.

This change enables the possibility to fix at least the below issues:

PR Checklist

@mnieto
Copy link
Contributor Author

mnieto commented Jan 6, 2023

@SebastianSchuetze, perhaps it could be a good idea to announce, in addition to #458 the removal of support to Powershell Desktop in the v8.x version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant